Skip to content

Commit

Permalink
feat: import temperatures and implement the simulation engine (#36)
Browse files Browse the repository at this point in the history
* feat(deps): add vitest
  • Loading branch information
ReidyT authored Oct 30, 2024
1 parent db4a273 commit b6d9af7
Show file tree
Hide file tree
Showing 37 changed files with 230,510 additions and 82 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
VITE_ENABLE_MOCK_API: true
VITE_VERSION: cypress-tests

- name: Vitest Run
run: yarn vitest
shell: bash

- name: Cypress Run
uses: cypress-io/github-action@v5
env:
Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,47 @@ If an existing model is updated, we should replace the type and the React compon

The positions of the meshes within the group are auto-generated, and they should never be manually modified. If an object needs to be repositioned, adjust its `position` prop applied directly to the group instead. This maintains consistency and ensures the auto-generated structure remains intact while allowing for flexible positioning.

## Downloading a CSV File

To download a CSV file of temperatures, follow these steps:

1. **CSV File Requirements**:

- The CSV file must contain a header.
- The first column should represent time in GMT+0, formatted in ISO 8601.
- The second column should contain the temperature values in °C.

```
time,temperature
1999-01-01T00:00,3.9
1999-01-01T01:00,3.7
```

Or

```
time,temperature
1999-01-01,4.5
1999-01-02,3.6
```

2. **File Location**:

- Ensure that your CSV file is located in the `public` directory of your project.
- For example, if your file is named `temperatures.csv`, the path will be `'temperatures.csv'` when referencing it from the public directory (i.e., `public/temperatures.csv`).

3. **Data Source**:

- You can download the required CSV data from [Open Meteo](https://open-meteo.com/).

> [!WARNING]
> The measurement frequency changes depending on whether you are querying historical data (one temperature value per hour) or future predictions (one temperature value per day).
4. **Using the `TemperatureContext`**:
- In `TemperatureContext`, you can load this CSV file by referencing the appropriate path. Make sure to handle the data correctly based on the specified format and structure. Also be sure to specify the measurement frequency, which can be either per hour or per day, based on your needs.

Following these guidelines will ensure that your CSV file is correctly set up and accessible for the application.

### Credits

The house and tree models are created by [Sloyd.ai](https://www.sloyd.ai). All rights reserved by Sloyd for these models.
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"i18next": "^23.9.0",
"papaparse": "^5.4.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-i18next": "14.1.3",
Expand Down Expand Up @@ -64,6 +65,7 @@
"@eslint/js": "^9.12.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/i18n": "0.13.12",
"@types/papaparse": "^5.3.15",
"@types/three": "^0",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "7.18.0",
Expand Down Expand Up @@ -94,7 +96,8 @@
"uuid": "9.0.1",
"vite": "^5.1.3",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-istanbul": "^6.0.0"
"vite-plugin-istanbul": "^6.0.0",
"vitest": "^2.1.3"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit b6d9af7

Please sign in to comment.