Call-for-Code / Prometeo-Pyrrha

Former repository for Prometeo, winner of the Call for Code 2019 Global Challenge, open sourced as Pyrrha (see links within this repo). It measures toxin exposure in real time and analyzes trends over time.
http://pyrrha-platform.org
Apache License 2.0
27 stars 18 forks source link

Add gauge tests and tests for a second gas. Also finish off documentation. #116

Open JSegrave-IBM opened 3 years ago

JSegrave-IBM commented 3 years ago

Add gauge tests and tests for a second gas.

  1. Previously, the tests only tested the TWA exposure calculations, not the comparison of those exposures to the corresponding limits - i.e. the limit 'gauge' percentages. This change adds those tests.
  2. Previously, the tests only tested one gas - carbon monoxide. This change adds tests for nitrogen dioxide as well. We don't have real nitrogen dioxide data yet, so it's mocked up data.

Additional changes to support these tests:

  1. Added gas-specific rounding factors as carbon monoxide and nitrogen dioxide have different ranges.
  2. Added the ability to let the tests override the windows & limits configurations, as the test results are all tied to a specific configuration.
  3. Added CAL-OSHA, NIOSH and AEGL-2 example configurations to show how configuration might differ for other geographical regions, such as the NIOSH/ACGIH, CAL-OSHA or AEGL-2. This also facilitated confirming that the tests should fail (and do) when the wrong configuration is used.
  4. Finished off outstanding documentation and dealt with most of the TODO's.
  5. Modified DB field names to make them less sensitive to configuration changes. Fields for the different time-window TWAs are now named the after the number of minutes in that window (stable) and not by the display name (less stable and prone to SQL issues).
JSegrave-IBM commented 3 years ago

PR https://github.com/Code-and-Response/Prometeo-Rules-Decision/pull/9

JSegrave-IBM commented 3 years ago

@lidderupk - I added the DB field name change to this issue & associated PR.

  1. Modified DB field names to make them less sensitive to configuration changes. Fields for the different time-window TWAs are now named the after the number of minutes in that window (stable) and not by the display name (less stable and prone to SQL issues).
JSegrave-IBM commented 3 years ago

Dependent on: