Skip to content

Commit

Permalink
file name fixes for the new tests (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhosale authored Jun 27, 2024
1 parent 50741d0 commit 83e6cac
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions quartz_solar_forecast/inverters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ Open-Source-Quartz-Solar-Forecast/
│ └── inverters/
├── tests/
│ └── data/
│ └── test_make_pv_data.py
│ | └── test_process_pv_data.py
│ └── inverters/
│ └── test_process_enphase_data.py
```

## What each Directory holds

1. `example/`

* `inverter_example.py`: Makes input data depending on the inverter type and compares it with the type with no data and runs the ML model along with a comparison plot using `plotly`. This is the file that you need to run in order to run the ML model. An example output with Enphase is demonstrated below:

![example_enphase_output](https://github.com/aryanbhosale/Open-Source-Quartz-Solar-Forecast/assets/36108149/7127a00e-c081-4f5e-a342-2be2e2efe00c)

2. `quartz_solar_forecast`:

* `data.py`: Contains the `make_pv_data()` function, that conditionally checks the inverter type and constructs and `xarray` dataframe
* `pydantic_models.py`: Contains the PVSite class
* `inverters/`:
Expand All @@ -35,17 +38,21 @@ Open-Source-Quartz-Solar-Forecast/
* We need the past 7 days data formatted in intervals of 5 minutes for this model. Given below is an example with Enphase

![example_enphase_data](https://github.com/aryanbhosale/Open-Source-Quartz-Solar-Forecast/assets/36108149/436c688c-2e59-4047-abfc-754acb629343)

* Once all the processing is done, make sure that your return type is of `pd.DataFrame` that has 2 colums, namely

* `timestamp`: `timestamp=datetime.fromtimestamp(interval_end_time_in_unix_epochs, tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S')`, and then convert the timestamp column to `pd.to_datetime`
* `power_kw`: Power in **KiloWatts.** An example is shown below with the formatted `pd.DataFrame`
![example_enphase_formatted_dataframe](https://github.com/aryanbhosale/Open-Source-Quartz-Solar-Forecast/assets/36108149/482b2f2a-e3f5-4a1a-97f1-2d322a1444d5)

3. `tests/`

* `data/`
* `test_make_pv_data.py`: Mocks the `make_pv_data()` function `data.py` file using various type of inverters and the `None` value too using `pytest`
* Run this using `pytest tests/data/test_make_pv_data.py`

* `test_process_pv_data.py`: Mocks the `process_pv_data()` function in the `data.py` file using various type of inverters and the `None` value too using `pytest`
* Run this using `pytest tests/data/test_process_pv_data.py`
* `inverters/`

* `test_process_enphase_data.py`: Mocks the `process_enphase_data()` function in the `/inverters/enphase.py` file using `pytest`
* Run this using `pytest tests/inverters/test_process_enphase_data.py`

## How to Setup

Expand Down

0 comments on commit 83e6cac

Please sign in to comment.