Skip to content

Commit

Permalink
Re-named files and adapted scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lrdossan committed Nov 18, 2024
1 parent 12c266a commit 3d5ca48
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 80 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Run the `style_docs.py` script to apply custom styles, move required files, and

```
python style_docs.py \
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code_documentation/models.md \
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code/models.md \
&& pyreverse -o png -p UML-CAiMIRA --output-directory mkdocs/docs ../src/caimira/calculator/models/models.py
```

Expand Down
4 changes: 2 additions & 2 deletions caimira/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ WORKDIR /app/docs

# Run the Python script to update markdown files, move it, and generate UML diagram
RUN python3 style_docs.py \
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code_documentation/models.md \
&& pyreverse -o png -p UML-CAiMIRA --output-directory mkdocs/docs/code_documentation ../src/caimira/calculator/models/models.py
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code/models.md \
&& pyreverse -o png -p UML-CAiMIRA --output-directory mkdocs/docs/code ../src/caimira/calculator/models/models.py

# Mkdocs directory
WORKDIR /app/docs/mkdocs
Expand Down
9 changes: 9 additions & 0 deletions caimira/docs/mkdocs/docs/code/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This page contains a Unified Modeling Language (UML) diagram describing all the data classes and their relations.

## CAiMIRA UML Diagram

The following diagram describes all the data classes and their relations under the `models.py` file. Click the diagram to zoom-in.

[![CAiMIRA UML diagram](classes_UML-CAiMIRA.png)](classes_UML-CAiMIRA.png)

CAiMIRA `models.py` file UML diagram.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CAiMIRA REST API

The API enables third-party applications to interact with the CAiMIRA [backend](https://gitlab.cern.ch/caimira/caimira), making integration easier and more flexible. This page covers the CAiMIRA [package structure](#directory-layout-key-components), [API usage](#rest-api-overview), [deployment processes](#deployment-process), including versioning guidelines.
The API enables third-party applications to interact with the CAiMIRA [backend](https://gitlab.cern.ch/caimira/caimira), making integration easier and more flexible. This page covers the CAiMIRA [package structure](#directory-layout-key-components) and [API usage](#rest-api-overview).

## Package Overview

Expand Down Expand Up @@ -201,24 +201,4 @@ As the project is growing, more endpoints targeted to specific tasks will be dev
"room_capacity": "10",
"room_volume": "60",
"total_people": "2"
}'

## Deployment Process

The deployment process varies depending on whether changes are pushed to branches, tags, or the test environment (`live/caimira-test` branch).

### Branch and Tag-based Deployment

For branch pushes:

* All branches (except `live/caimira-test`) trigger the **test** stage in the CI/CD pipeline, ensuring the code passes all necessary tests before it is deployed.

For tag creation:

* When a new tag is created, the pipeline skips the previous tests, and it builds `Docker` images, storing them in GitLab's container registry. The images can be manually deployed to the OKD platform for the `PROD` - production environment.

### OKD Platform Deployment
The `cern_caimira` package, which contains the CERN-specific UI, is deployed directly to the OKD platform. The `caimira package`, which contains the backend logic, is deployed as a standalone API for integration with external services.

### Versioning and Tags
The repository follows a *semantic versioning* scheme, with tags named according to the `MAJOR.MINOR.PATCH` format (e.g., `v5.0.0`).
}'
28 changes: 15 additions & 13 deletions caimira/docs/mkdocs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ It includes details on the diameter-dependent mathematical model and the code de

# Contents:

* [Project Overview]()
* [About](project_overview/about.md)
* [Installation](project_overview/installation.md)
* [Deployment](project_overview/deployment.md)
* [User Guide]()
* [Quick Guide](project_overview/user_guide/quick_guide.md)
* [Full Guide](project_overview/user_guide/full_guide.md)
* [Open Source Acknowledgments](project_overview/open_source_acknowledgments.md)

* [Code Documentation]()
* [Diameter Normalization](code_documentation/diameter_normalization.md)
* [REST API](code_documentation/rest_api.md)
* [Models Module](code_documentation/models.md)
* [About](root/about.md)
* [Installation](root/installation.md)
* [Deployment](root/deployment.md)
* [Open Source Acknowledgments](root/open_source_acknowledgments.md)
* [License](LICENSE.md)
* [Physics of the model](root/physics_model.md)
* **Code**
* [Architecture](code/architecture.md)
* [models.py](code/models.md)
* [REST API](code/rest_api.md)
* **User Interfaces**
* **CAiMIRA Calculator**
* [Quick Guide](user_interfaces/CAiMIRA/quick_guide.md)
* [Full Guide](user_interfaces/CAiMIRA/full_guide.md)
* [ARIA](https://partnersplatform.who.int/aria)
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,28 @@ As a result, WHO has invited CERN to become a member of a multidisciplinary expe
The collaboration takes place within CERNs wide-ranging engagement with other international organisations, promoting shared solutions to societal challenges.

## Authors
CAiMIRA was developed by the following members of CERN - European Council for Nuclear Research (visit [https://home.cern/](https://home.cern/)) and WHO - World Health Organization:

Andre Henriques<sup>1</sup>, Luis Aleixo<sup>1</sup>, Marco Andreini<sup>1</sup>, Gabriella Azzopardi<sup>2</sup>, James Devine<sup>3</sup>, Philip Elson<sup>4</sup>, Nicolas Mounet<sup>2</sup>, Markus Kongstein Rognlien<sup>2,6</sup>, Nicola Tarocco<sup>5</sup>, Luca Fontana<sup>7</sup>, Alice Simniceanu<sup>7</sup>
Andre Henriques<sup>1,2</sup>, Wei Jia<sup>3</sup>, Luis Aleixo<sup>1</sup>, Nicolas Mounet<sup>1</sup>, Luca Fontana<sup>4,5</sup>, Alice Simniceanu<sup>2,6</sup>, James Devine<sup>1</sup>, Philip Elson<sup>1</sup>, Gabriella Azzopardi<sup>1</sup>, Markus Kongstein Rognlien<sup>1,7</sup>, Marco Andreini<sup>1</sup>, Nicola Tarocco<sup>1</sup>, Olivia Keiser<sup>2</sup>, Yugou Li<sup>3</sup>, Julian Tang<sup>8</sup>

<sup>1</sup>HSE Unit, Occupational Health & Safety Group, CERN<br>
<sup>2</sup>Beams Department, Accelerators and Beam Physics Group, CERN<br>
<sup>3</sup>Experimental Physics Department, Safety Office, CERN<br>
<sup>4</sup>Beams Department, Controls Group, CERN<br>
<sup>5</sup>Information Technology Department, Collaboration, Devices & Applications Group, CERN<br>
<sup>6</sup>Norwegian University of Science and Technology (NTNU)<br>
<sup>7</sup>World Health Organization (WHO)<br>
<sup>1</sup>CERN (European Organization for Nuclear Research), Geneva, Switzerland<br>
<sup>2</sup>Institute of Global Health, University of Geneva, Geneva, Switzerland<br>
<sup>3</sup>Department of Mechanical Engineering, University of Hong Kong, Hong Kong SAR, China<br>
<sup>4</sup>Strategic Health Operations, Operations Support and Logistic, Health Emergencies Programme, World Health Organization, Geneva, Switzerland<br>
<sup>5</sup>Department of Civil and Mechanical Engineering, Università degli studi di Cassino e del Lazio Meridionale (UNICAS), Cassino, Italy<br>
<sup>6</sup>Epidemic and Pandemic Preparedness, Health Emergencies Programme, World Health Organization, Geneva, Switzerland<br>
<sup>7</sup>Norwegian University of Science and Technology (NTNU), Torgarden, Norway<br>
<sup>8</sup>Respiratory Sciences, University of Leicester, Leicester, UK<br>

#### Other contributors

Anna Efimova<sup>1,2</sup>, Anel Massalimova<sup>1,3</sup>, Cole Austin Coughlin<sup>1,4</sup>, Germain Personne<sup>5</sup>
Anna Efimova<sup>1,2</sup>, Anel Massalimova<sup>1,3</sup>, Cole Austin Coughlin<sup>1,4</sup>, Germain Personne<sup>5</sup>, Matteo Manzinello<sup>6</sup>, Elias Sandner<sup>1</sup>

<sup>1</sup>Summer Student Programme, CERN<br>
<sup>1</sup>CERN<br>
<sup>2</sup>M.V. Lomonosov Moscow State University<br>
<sup>3</sup>National Research Nuclear University "MEPhI"<br>
<sup>4</sup>University of Manitoba<br>
<sup>5</sup>Université Clermont Auvergne<br>
<sup>6</sup>World Health Organization (WHO)<br>

## Reference and Citation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,22 @@ but it may be origin if you haven't configured it differently):

git push --force upstream name-of-local-branch:live/caimira-test

## Deployment Process

The deployment process varies depending on whether changes are pushed to branches, tags, or the test environment (`live/caimira-test` branch).

### Branch and Tag-based Deployment

For branch pushes:

* All branches (except `live/caimira-test`) trigger the **test** stage in the CI/CD pipeline, ensuring the code passes all necessary tests before it is deployed.

For tag creation:

* When a new tag is created, the pipeline skips the previous tests, and it builds `Docker` images, storing them in GitLab's container registry. The images can be manually deployed to the OKD platform for the `PROD` - production environment.

### OKD Platform Deployment
The `cern_caimira` package, which contains the CERN-specific UI, is deployed directly to the OKD platform. The `caimira package`, which contains the backend logic, is deployed as a standalone API for integration with external services.

### Versioning and Tags
The repository follows a *semantic versioning* scheme, with tags named according to the `MAJOR.MINOR.PATCH` format (e.g., `v5.0.0`).
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The response format will be:
}
```

For further details please refer to the [REST API documentation page](../code_documentation/rest_api.md).
For further details please refer to the [REST API documentation page](../code/rest_api.md).

#### Running the Expert-Apps

Expand Down Expand Up @@ -217,7 +217,7 @@ To compile and view CAiMIRA's documentation, follow these steps:
Run the `style_docs.py` script to apply custom styles, move required files, and generate a UML diagram:

python style_docs.py \
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code_documentation/models.md \
&& mv sphinx/_build/markdown/index.md mkdocs/docs/code/models.md \
&& pyreverse -o png -p UML-CAiMIRA --output-directory mkdocs/docs ../src/caimira/calculator/models/models.py

4. Start the documentation server
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Diameter-dependent Model
# Physics of the Model

This section describes the CAiMIRA model and its dependence on the Particles diameter. A Unified Modeling Language (UML) diagram describing all the data classes and their relations can be found [here](#caimira-uml-diagram), at the bottom of the document.
This page describes the CAiMIRA model and its dependence on the Particles diameter.

## Context

Expand Down Expand Up @@ -304,16 +304,6 @@ Note still that nothing depends on the aerosol diameter $D$ in this case (no par
Since the CO<sub>2</sub> concentration differs from the virus concentration, the specific removal rate, CO<sub>2</sub> atmospheric concentration and normalization factors are respectively defined in `caimira.models.models.CO2ConcentrationModel.removal_rate()`,
`caimira.models.models.CO2ConcentrationModel.min_background_concentration()` and `caimira.models.models.CO2ConcentrationModel.normalization_factor()`.

<a id="caimira-uml-diagram"></a>

## CAiMIRA UML Diagram

The following diagram describes all the data classes and their relations under the models.py file. Click the diagram to zoom-in.

[![CAiMIRA UML diagram](classes_UML-CAiMIRA.png)](classes_UML-CAiMIRA.png)

CAiMIRA `models.py` file UML diagram.

## References

* <a id='id7'>**[1]**</a> Jia, Wei, et al. “Exposure and respiratory infection risk via the short-range airborne route.” Building and environment 219 (2022): 109166. [doi.org/10.1016/j.buildenv.2022.109166](https://doi.org/10.1016/j.buildenv.2022.109166)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## CAiMIRA Calculator
## [CAiMIRA Calculator](https://caimira.web.cern.ch/)

This guide helps on how to use the calculator app. For more information on the Airborne Transmission of SARS-CoV-2, feel free to check out the HSE Seminar: [https://cds.cern.ch/record/2743403](https://cds.cern.ch/record/2743403)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## CAiMIRA Calculator
## [CAiMIRA Calculator](https://caimira.web.cern.ch/)

This tool simulates the airborne spread of SARS-CoV-2 virus in a finite volume and estimates the risk of COVID-19 infection. It is based on current scientific data and can be used to compare the effectiveness of different mitigation measures.

Expand Down
28 changes: 15 additions & 13 deletions caimira/docs/mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ theme:

nav:
- Home: index.md
- Project Overview:
- About: project_overview/about.md
- Installation: project_overview/installation.md
- Deployment: project_overview/deployment.md
- User Guide:
- Quick Guide: project_overview/user_guide/quick_guide.md
- Full Guide: project_overview/user_guide/full_guide.md
- Open Source Acknowledgments: project_overview/open_source_acknowledgments.md
- License: LICENSE.md
- Code Documentation:
- Diameter Normalization: code_documentation/diameter_normalization.md
- REST API: code_documentation/rest_api.md
- Models Module: code_documentation/models.md
- About: root/about.md
- Installation: root/installation.md
- Deployment: root/deployment.md
- Open Source Acknowledgments: root/open_source_acknowledgments.md
- License: LICENSE.md
- Physics of the model: root/physics_model.md
- Code:
- Architecture: code/architecture.md
- models.py: code/models.md
- REST API: code/rest_api.md
- User Interfaces:
- CAiMIRA Calculator:
- Quick Guide: user_interfaces/CAiMIRA/quick_guide.md
- Full Guide: user_interfaces/CAiMIRA/full_guide.md
- ARIA: https://partnersplatform.who.int/aria

markdown_extensions:
- pymdownx.arithmatex:
Expand Down
4 changes: 2 additions & 2 deletions caimira/docs/style_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def main():
print(f"File '{index_file_path}' does not exist, skipping update.")

# Path to the open source acknowledgements markdown file to be updated
acknowledgements_file_path = 'mkdocs/docs/project_overview/open_source_acknowledgments.md'
acknowledgements_file_path = 'mkdocs/docs/root/open_source_acknowledgments.md'

if os.path.isfile(acknowledgements_file_path):
# Retrieve package details
Expand All @@ -209,7 +209,7 @@ def main():
add_python_dependencies_section(acknowledgements_file_path, package_details)

# Generate the pie chart
output_image_path = 'mkdocs/docs/project_overview/license_distribution.png'
output_image_path = 'mkdocs/docs/root/license_distribution.png'
generate_license_distribution_pie_chart(package_details, output_image_path)
else:
print(f"File '{acknowledgements_file_path}' does not exist, skipping update.")
Expand Down

0 comments on commit 3d5ca48

Please sign in to comment.