ukaea / bom_analysis

A framework for performing analysis based on a Bill of Materials (BOM) structure. Creates data storage structure that follows a hierarchical BOM which can be operated on. Developed for STEP Outboard Blankets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation Status Coverage DOI Latest Release

Quality gate

Bill of Materials Analysis

This repository allows for an engineering assembly to be represented in a Bill of Materials (BOM) structure for analysis. The aim was to reduce the cognative complexity of the various data sets that are required for input or output of an analysis workflow. The repository also includes a number of features to help with this analysis.

The motivation for this package comes from a desire to order complex system data used by analysis in a logical. The chosen method for ordering this data is the bill of materials as it provides a common framework used across engineering.

The bill of materials provides a hieracy of materials, components, and assemblies all of which can contain data that is important for the analysis. For example, a user may want to assess the mass of an assembly by summing the mass of all the components in that make it up.

The Bill of Materials can be plotted to help understand the system (taken from example):

tokamak
├── coil_set
│   ├── east
│   ├── north
│   ├── south
│   └── west
└── divertor

The data for each of the components can also be displayed easily:

================================================================================
| var           │ value   │ unit          │ description                        │
================================================================================
│ mass          │ 1000    │ metric_ton    │                                    │
================================================================================
│ configuration │ ST      │ dimensionless │                                    │
================================================================================
│ major_radius  │ 2       │ meter         │ the geometric centre of the plasma │
================================================================================    

Installation

The easiest way to install bom_analysis is using pip pip:

pip install bom_analysis

Help and Support

Testing

BOM Analysis contains a test suite that can be ran using pytest (must be installed). Three markers have been used to distiguish the different testing levels:

  • unittest: runs unit tests that generally only test an individual method by using mocking
  • integrationtest: runs the integration tests
  • regressiontest: tests bugs that have been indentified in other versions

The full test suite can be ran by navigating to the source directory and running pytest:

pytest 

It is possible to filter the tests by the markers:

pytest -m "unittest"

Or filter out markers:

pytest -m "not integrationtest and not regressiontest"

License

BSD 3

About

A framework for performing analysis based on a Bill of Materials (BOM) structure. Creates data storage structure that follows a hierarchical BOM which can be operated on. Developed for STEP Outboard Blankets.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%