Skip to content

Commit

Permalink
update wedowind branch (#25)
Browse files Browse the repository at this point in the history
* Update smarteole_example.ipynb

fix issue, CACHE_SUBDIR is missing if data has never been downloaded

* Update smarteole_example.ipynb

fix ruff issue

* Update smarteole_example.ipynb

try to fix ruff issue

* fix issues after updating ruff

* Fix plotconfig mkdir (#16)

* remove make_plots_dir

* Update main_analysis.py

fix missing dir issue

* bump version

* Update smarteole_example.ipynb

* Update smarteole_example.ipynb

filter SmallSampleWarning

* Update smarteole_example.ipynb

fix ruff issue

* Create wind-up uplift validation methodology.pdf

* Cleanup  requests dependency and move to examples group (#19)

* Cleanup  requests dependency and move to examples group

* Jupyter group moved to examples and all group added

* Update pyproject.toml

define all using other groups

---------

Co-authored-by: Alex Clerc <alex.clerc@res-group.com>

* support Python 3.9 (#17)

* try Python 3.9 in workflow

* Update lint-and-test.yaml

* try from __future__ import annotations

* Update conftest.py

* add eval-type-backport

* more from __future__ import annotations

* remove TypeAlias

* replace zip with strict_zip

* ignore 3.9 mypy issues

* fix bug in backporting.py

* Update lint-and-test.yaml

* Update lint-and-test.yaml

* Update pyproject.toml

move types-requests to dev

* Update smarteole_example.ipynb

* Update smarteole_example.ipynb

* Update smarteole_example.ipynb

* Define supported python (#23)

* add badge to README

* Update pyproject.toml

* Update lint-and-test.yaml

* update classifiers

* Update lint-and-test.yaml

* Update README.md

* Update smarteole_example.ipynb

* Update lint-and-test.yaml

* Update README.md

* Update smarteole_example.ipynb

* fix methodology link

---------

Co-authored-by: Gorkem Kacar <139143704+izofat@users.noreply.github.com>
  • Loading branch information
aclerc and izofat authored Sep 8, 2024
1 parent d9d5307 commit 5f6fbed
Show file tree
Hide file tree
Showing 36 changed files with 540 additions and 290 deletions.
77 changes: 38 additions & 39 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,49 @@ name: Lint and test

on:
push:
branches: [ main ]
branches:
- main
pull_request:

env:
python-version: "3.10"
branches:
- main

permissions:
contents: read

jobs:
lint-and-test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.x"]
os: [ubuntu-latest]
steps:
- name: "checkout repository"
uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: 'set up Python ${{ inputs.python-version }}'
with:
python-version: ${{ env.python-version }}

- uses: actions/cache@v4
id: cache-venv
with:
path: ./.venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-venv-
- name: 'create virtualenv and install dependencies'
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install .[dev]
- name: 'update dependencies'
if: steps.cache-venv.outputs.cache-hit == 'true'
run: |
source .venv/bin/activate
pip install -U .[dev]
- name: "lint check & test"
run: |
source .venv/bin/activate
poe lint-check
poe test
- uses: actions/checkout@v4
- name: "set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
id: cache-venv
with:
path: ./.venv/
key: ${{ matrix.python-version }}-venv-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.python-version }}-venv
- name: 'create environment and install dependencies'
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install .[dev]
- name: 'update dependencies'
if: steps.cache-venv.outputs.cache-hit == 'true'
run: |
source .venv/bin/activate
pip install -U .[dev]
- name: "lint check & test"
run: |
source .venv/bin/activate
poe lint-check
poe test
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# wind-up
A tool to assess yield uplift of wind turbines

[![lint-and-test](https://github.com/resgroup/wind-up/actions/workflows/lint-and-test.yaml/badge.svg)](https://github.com/resgroup/wind-up/actions/workflows/lint-and-test.yaml)
[![Python 3.10](https://img.shields.io/badge/python-≥3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)
[![image](https://img.shields.io/pypi/v/res-wind-up.svg)](https://pypi.python.org/pypi/res-wind-up)
[![image](https://img.shields.io/pypi/l/res-wind-up.svg)](https://github.com/resgroup/wind-up/blob/main/LICENSE.txt)
[![image](https://img.shields.io/pypi/pyversions/res-wind-up.svg)](https://pypi.python.org/pypi/res-wind-up)
[![Lint & Format: Ruff](https://img.shields.io/endpoint?url=https://github.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Typing: mypy](https://img.shields.io/badge/typing-mypy-yellow.svg)](https://github.com/python/mypy)
[![TaskRunner: poethepoet](https://img.shields.io/badge/poethepoet-enabled-1abc9c.svg)](https://github.com/nat-n/poethepoet)
[![lint-and-test](https://github.com/resgroup/wind-up/actions/workflows/lint-and-test.yaml/badge.svg)](https://github.com/resgroup/wind-up/actions/workflows/lint-and-test.yaml)

## Getting Started
See [`examples`](examples) folder for example analysis using the wind-up package. [`smarteole_example.ipynb`](examples%2Fsmarteole_example.ipynb) is a good place to start.
Expand Down Expand Up @@ -36,7 +37,7 @@ cd wind-up
python -m venv .venv
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
# install the package in editable mode with the dev dependencies
pip install -e .[dev] # or .[jupyter,dev] if you want jupyter dependencies as well
pip install -e .[dev] # or .[all] if you want examples dependencies as well or .[examples] if you want only examples dependencies
```
Use `poe all` to run all required pre-push commands (make sure the virtual environment is activated)

Expand Down
Binary file added docs/wind-up uplift validation methodology.pdf
Binary file not shown.
6 changes: 5 additions & 1 deletion examples/helpers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from __future__ import annotations

import logging
import math
from collections.abc import Collection
from pathlib import Path
from typing import TYPE_CHECKING

import requests

if TYPE_CHECKING:
from collections.abc import Collection
logger = logging.getLogger(__name__)

BYTES_IN_MB = 1024 * 1024
Expand Down
Loading

0 comments on commit 5f6fbed

Please sign in to comment.