Skip to content
jmoeckel edited this page Nov 5, 2015 · 1 revision

Guidelines regarding the structure of the library.

2.1 Alphabetically Order of Packages

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)

2.2 Top-Level Packages

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.

2.3 Mandatory Subpackages

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.

2.4 Filewise Implementation

Models, Functions and Blocks must be implemented file-wise, i.e. one model, function or block per file.

2.5 Partial Classes

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

2.6 Examples

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.

2.7 Fluid Flow Systems

In the case of fluid flow systems, implement components by extending the partial classes in Annex60.Fluid.Interfaces.

2.8 Instantiating a Class

Use the full package names when instantiating a class.

2.9 Comments

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.