Skip to content

Commit a1fafd7

Browse files
JrtPecMolier
andauthored
0.0.14. Capacity Analysis. Refactoring. Poetry Package Manager. (#9)
* Allow the case where not all participants have offtake, injection or a key * readmes updated * added capacity analysis with demo nb * python compat removal >3.10 * key validation to 3 decimal values * added poetry as package manager and updated the requirements and dev requirements * review * imports * samples * add seaborn requirement-dev * remove rounding from output * Capacity analysis typechanges to make it more pure and only use inout outputmodels in the demo * feat: Add PeakDetail model to capacity module * chore: Ruff import removal * chore: Update pre-commit hooks with pyupgrade v3.16.0 refactoring to upgrade to python311 * feat: added a test you can run for all the notebooks. (#8) * chore: Update pre-commit hooks with pyupgrade v3.16.0 refactoring to upgrade to python311 * chore: made requirements more human readable * feat: Update dependencies for entsoe-py and energyid * chore: Add test suite for notebook execution --------- Co-authored-by: Jan Pecinovsky <jan.pecinovsky@energieid.be> * Version Bump --------- Co-authored-by: Molier <oscar.swyns@hotmail.com> Co-authored-by: Oscar <7408635+Molier@users.noreply.github.com>
1 parent 9061782 commit a1fafd7

29 files changed

+217863
-162576
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.5.2
4+
rev: v0.5.5
55
hooks:
66
# Run the linter.
77
- id: ruff
@@ -10,3 +10,9 @@ repos:
1010
# Run the formatter.
1111
- id: ruff-format
1212
types_or: [python, pyi, jupyter]
13+
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v3.16.0
16+
hooks:
17+
- id: pyupgrade
18+
args: [--py311-plus]

DEVELOPERS.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Development Environment Setup
2+
3+
This guide outlines the setup process for our development environment, focusing on packaging and dependency management.
4+
## Info on dev setup
5+
### Commit practices (pre-commit)
6+
we use [pre-commit ](https://pre-commit.com/)to run RUFF.
7+
### Poetry for Packaging and Dependency Management
8+
9+
We use [Poetry](https://python-poetry.org/docs/main/#installation) as our primary tool for packaging and managing dependencies. Poetry provides a simple yet powerful way to manage project dependencies and publish packages.
10+
11+
For the most detailed and up-to-date information, please refer to the [official Poetry 📚](https://python-poetry.org/docs/main/#installation).
12+
13+
### Installing Python CLI Applications Globally with pipx
14+
15+
To ensure that Python CLI applications are installed globally on your system while being isolated in their own virtual environments, we utilize `pipx`.
16+
17+
## Steps to Install pipx and Poetry
18+
19+
1. First, [install pipx](https://pipx.pypa.io/stable/installation/) following the instructions on the official website.
20+
2. Once pipx is installed, you can easily install Poetry by running the following command in your terminal:
21+
```pipx install poetry```
22+
3. (*optional*) [install](vscode:extension/zeshuaro.vscode-python-poetry) vscode extension for poetry
23+
### Setup with Poetry
24+
```shell
25+
poetry install
26+
```
27+
### publishing with poetry
28+
https://python-poetry.org/docs/repositories/
29+
## Remarks for devcontainer
30+
31+
You can also work inside a docker container(devcontainer).
32+
To make sure you have access/permissions inside the devcontainer.
33+
From inside the devcontainer after launch, check user and take ownership:
34+
35+
```bash
36+
whoami
37+
sudo chown -R $USER:$USER /workspaces/ -R
38+
```
39+
40+
other option is to run as root from within the `devcontainer.json` `"remoteUser": "root"`
41+
42+
# Useful commands for dev work
43+
## clean up
44+
[vulture](https://github.com/jendrikseipp/vulture) for finding dead python 🐍
45+
```pipx run vulture . --exclude venv```
46+
47+
[deptry](https://github.com/fpgmaas/deptry) for checking dependencies
48+
```pipx run deptry . --ignore-notebooks```

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# OpenEnergyID
2+
23
Open Source Python library for energy data analytics and simulations
4+
5+
[*more info for developers*](DEVELOPERS.md)

0 commit comments

Comments
 (0)