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 e5a8670
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 69 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)
File renamed without changes.
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 e5a8670

Please sign in to comment.