-
Notifications
You must be signed in to change notification settings - Fork 34
Architecture
Guidelines regarding the structure of the library.
Packages are first sorted alphabetically by the function _sort_package_order
. That function is part of BuildingsPy and is called by
import buildingspy.development.refactor as r
r.write_package_order(".", True)
After alphabetical sorting, the following packages, if they exist, are moved to the front:
Tutorial
UserGuide
Examples
and the following packages, if they exist, are moved to the end:
Data
Types
Validation
Benchmarks
Experimental
Interfaces
BaseClasses
Internal
Obsolete
The remaining classes are ordered as follows and inserted between the above list: First, models, blocks and records are listed, then functions, and then packages.
First and second level packages have usually the following subpackages:
- UsersGuide containing an overall description of the library and how to use it.
- Examples containing models demonstrating the usage of the library.
- Interfaces containing connectors and partial models.
- Types containing type, enumeration and choice definitions.
Models, Functions and Blocks must be implemented file-wise, i.e. one model, function or block per file.
Partial classes and base classes that are not of interest to the user should be stored in a subdirectory called BaseClasses. Each other class except for constants must have an icon
Examples and validation models should be in directories such as Valves.Examples and Valves.Validations. A script for the regression tests must be added as described below.
In the case of fluid flow systems, implement components by extending the partial classes in Annex60.Fluid.Interfaces.
Use the full package names when instantiating a class.
Comments should be added to each class (e.g. package, model, function). The first character should be upper case. For one-line comments of parameters, variables and classes, no period should be used at the end of the comment.