Directory structure

One thing that hasn't been mentioned yet is the directory structure for this project. So far, the assumption has been that you are placing all of these items within the same directory, or have an intelligent way to separate files, as in the case of tests.

The following screenshot shows the current directory structure as created on my computer:

Project directory tree

This output was provided by the Linux tree command, and it shows all important directories and files from the project's root directory. You'll note that there are a lot of __init__.py files scattered throughout. Each directory that has an __init__.py file is treated as if it contains Python packages, regardless of whether it actually does. This prevents directories with common names, such as OS-specific directories, from hiding valid modules that happen to have the same name.

The models directory is designed to hold any fluid model. Currently, we only have the fuel farm model that we have been talking about, so it only contains the FuelFarm subdirectory. Within that subdirectory are the two files that we will write in this chapter and an hmi subdirectory that we will cover in a later chapter, when we learn how to put a graphical interface to this project.

The PipingSystems directory contains the subdirectories for the pump, tank, and valve-modeling files. The user_creation_script.py file is a program in development, and will not be discussed in this book.

The tests directory contains all the tests for the entire program. The models subdirectory contains the tests for any models that we create, while piping holds the tests for the initial modeling code.

The Utilities directory currently holds the utility_formulas.py file we created during our initial modeling, but it can also contain future tools for different models.

Finally, venv is the directory that holds all the necessary files and configurations for our pipenv virtual Python environment. It is created automatically when we create a new pipenv.