Commit graph

127 commits

Author SHA1 Message Date
Nicolas Mounet
d83dfa01df Cosmetics in test_model_generator.py (error messages with input keys in double quotes) 2025-07-23 14:47:07 +00:00
Nicolas Mounet
9104bf7c05 Fixing tests in test_model_generator.py following previous commits (error messages slightly changed) 2025-07-23 08:36:04 +00:00
lrdossan
a61d065b83 added population models generation (infected and exposed) 2025-03-25 15:16:45 +01:00
lrdossan
a56ad5f77a updates following reviewing process:
- replaced 'dynamic_exposed_occupancy', 'dynamic_infected_occupancy' and 'dynamic_occupancy' by 'occupancy' that encompasses both
- developed respective functionality, including CAiMIRA UI and REST API
- simplified logic with entry overlaps and respective validation
- simplified CO2 logic with dynamic groups
- simplified logic with alternative scenarios
- changed default identifier of unique group
- handled naming conventions
- updated existing tests and added new tests for the most recent structure
- generate docscrings update
2025-03-21 17:35:49 +01:00
lrdossan
4094eeff1b Added validation __post_init__ check in ExposureModelGroup class and respective tests 2025-03-19 15:45:06 +01:00
lrdossan
61c6b2c2c3 Enhancements for Dynamic and Static Occupancy Handling
- Added default 'static' keyword to single group with static occupancy
- Added default values for 'dynamic_exposed_occupancy' and 'dynamic_infected_occupancy'
- Adapted default model to use ExposureModelGroup instance when static occupancy is defined
- Updated JS methods to generate multiple plots when dynamic occupancy is defined
- Handled the alternative scenario generation when dynamic occupancy is defined
- Improved results generation for exposure groups
- Updated HTML report for visualising results across multiple groups
- Enhanced model representations
2025-03-19 15:45:05 +01:00
lrdossan
cd3df90c4c Added dynamic groups in backend and propagated required changes to requests
- Correction of typos

- Changes do model to accommodate group of exposure models

- Handled virus validator to accommodate group of exposure models

- Modifications to accomodate generation of results for exposure model group

- Added data registry attribute to exposuremodelgroups class

- Fixed test for dynamic models

- Defined ExposureModelGroup with required methods

- Adapted virus report data to generate results for groups of exposed population

- Build same distributions for different models

- Fixed bug with defaults

- Handled definition of a single ExposureModel root obj when only one group is defined

- Added short-range expirations per group

- Added full validation on short_range interactions with dynamic exposure model

- Added full set of tests

- Updated docstrings

- Added support for number of people in exposed population, which should be identical within each group

- Added type checks

- Added UI adjustments for expected new cases

- Adapted exposed population data format to accommodate constant total_people
2025-03-19 15:45:05 +01:00
Nicola
97dd9aab58
api: implement preflight request
* closes #442
2025-03-13 14:42:15 +01:00
lrdossan
8146224392 Added the two plot img, plot data to the return data of the fetch return (context). Adapted orders of labels 2024-11-05 09:48:07 +01:00
lrdossan
bfa20d5e06 updated validation method (and extra test) 2024-09-16 16:22:54 +02:00
lrdossan
b92bbb6334 changes after rebase from master 2024-09-16 14:48:46 +02:00
lrdossan
3c20ed0306 handled expected number of new cases calculation (including tests) 2024-09-16 11:43:36 +02:00
Nicola Tarocco
fcb419cc8e
tests: remove unused model version 2024-09-13 17:03:21 +02:00
lrdossan
ebde0e1ae4 extracted CO2 logic to a dedicated route 2024-09-03 16:53:13 +02:00
lrdossan
20b0467f89 Backend separation
- extract, isolate and package it in a completely independent Python module, versioned and in a way that allows releases on PyPI.org
- fixed error in placeholder for secondary school (data registry defaults)
- added restriction in pytest version to install
- expected number of new cases fix
- data registry update (schema v2.1.1)
- github update
- deprecate ExpertApplication and CO2Application
- changes to reflect schema update 2.0.2
- version update
- Fixed error with f_inf (short-range)
- new folder layout
- Conditional probability data update
- General fixes
- Fitting results in L/S/person
- CO2 fitting algorithm refinement
2024-09-02 17:39:46 +02:00
lrdossan
e0675ba634 adated docscrings and comments troughout the code following review 2024-09-02 11:23:52 +02:00
lrdossan
24062ffab9 fixed merge conflicts 2024-08-30 12:27:47 +02:00
lrdossan
7918779157 added tests for all the different scenarios 2024-08-30 10:48:50 +02:00
lrdossan
a217a83fcc wrote find state change tests for all data scenarios 2024-08-30 10:48:50 +02:00
lrdossan
f83a886928 added tests with RMSEP 2024-08-30 10:44:45 +02:00
Andre Henriques
dbdc6b5760 Merge branch 'feature/ACH_to_L_s_person' into 'master'
Fitting results: added flow rate data (l/s/p)

Closes #416

See merge request caimira/caimira!504
2024-08-30 09:22:32 +02:00
lrdossan
309b00a7cd added room_capacity as prop of room 2024-08-26 15:50:46 +02:00
lrdossan
bea7edb048 adapted test 2024-08-20 15:53:32 +01:00
lrdossan
eb0f5cc881 modified methods to get conditional probability data 2024-07-18 17:01:48 +02:00
lrdossan
ada64d6acc added test for lsp ventilation 2024-07-18 12:32:04 +02:00
lrdossan
b3f7321a28 added table for l/s/p results 2024-07-18 12:20:31 +02:00
lrdossan
bbb82d2927 removed unused import and fixed docstring 2024-07-15 09:03:42 +02:00
lrdossan
42570887b5 added test for scale with f_inf 2024-07-12 17:34:50 +02:00
lrdossan
ddaa77b1c9 added the fraction of infectious virus method in the test full algorithm file 2024-07-05 12:09:28 +02:00
lrdossan
fa38282186 removed aerosols_without_mask in order to always use aerosols method with the correction conversion factor 2024-07-05 12:09:27 +02:00
lrdossan
7cb762ec1f fixed error with f_inf (short-range) 2024-07-05 12:09:26 +02:00
lrdossan
c5cbd23cdd use "deactivated" concept instead of "deprecated" 2024-06-28 13:44:38 +01:00
lrdossan
f3fde95792 expert application (virus and CO2) are not anymore be maintained 2024-06-18 17:09:34 +02:00
Luis Aleixo
3c3758dfcd removal of viable_to_RNA_ratio_distribution and infectious_dose_distribution from data registry 2024-05-27 10:42:46 +02:00
Luis Aleixo
a0d8f45424 renamed new input "short_range_total_people" to "short_range_occupants" 2024-05-24 16:42:03 +02:00
Luis Aleixo
e61700aaad added test for expected new cases 2024-05-24 16:42:03 +02:00
Luis Aleixo
10146f9a18 added baseline model with sr 2024-05-24 16:42:03 +02:00
Luis Aleixo
c5963a978a Added timeout to fetch method 2024-03-06 14:26:35 +01:00
Nicola Tarocco
ddfe0b660e
tests: make report generation time limit configurable 2024-02-27 21:17:46 +01:00
Luis Aleixo
7199143257 removed authentication methods and tests for data service 2024-01-31 11:50:12 +01:00
Luis Aleixo
d79ef934cb finished injection of data_service param 2023-12-14 15:34:08 +01:00
Luis Aleixo
20e8bf1df7 added data_service attr where needed 2023-12-14 15:34:08 +01:00
Nicola Tarocco
bb51eaa360 config: inject data registry instance instead of static config
* closes #365
2023-12-14 15:34:08 +01:00
Luis Aleixo
23c8959244 fixed bug related to specific breaks 2023-12-14 14:49:06 +01:00
Nicolas Mounet
d53d62f3f3 Renaming finf in test_full_algorithm 2023-12-12 16:23:07 +01:00
Nicolas Mounet
1f90d08163 Multiplying all emission rate values by 0.305 (average of uniform distribution of f_inf - 0.01 to 0.6) in test_monte_carlo_full_models, to adapt it to f_inf now included in emission rate 2023-12-01 07:35:07 +01:00
Nicolas Mounet
605a2d3fb7 Adapting test_full_algorithm to new concentration with f_inf included (f_inf and HI displaced in SimpleConcentrationModel) 2023-12-01 07:33:26 +01:00
Nicolas Mounet
5b4345e40a Multiplying all known concentrations in test_exposure_model by f_inf=0.5, as concentration is now with f_inf included 2023-12-01 07:32:03 +01:00
Luis Aleixo
d70029d0ed Merge branch 'feature/CO2_fit' into 'master'
Fit ventilation and exhalation rates on CO2 sensor data

See merge request caimira/caimira!444
2023-11-22 15:43:00 +01:00
Luis Aleixo
f6abdc91c6 merged tests (custom and fixed) 2023-11-22 14:45:57 +01:00