Skip to content

Commit

Permalink
0.0.14. Capacity Analysis. Refactoring. Poetry Package Manager. (#9)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Version Bump

---------

Co-authored-by: Molier <[email protected]>
Co-authored-by: Oscar <[email protected]>
  • Loading branch information
3 people authored Jul 26, 2024
1 parent 9061782 commit a1fafd7
Show file tree
Hide file tree
Showing 29 changed files with 217,863 additions and 162,576 deletions.
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.2
rev: v0.5.5
hooks:
# Run the linter.
- id: ruff
Expand All @@ -10,3 +10,9 @@ repos:
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py311-plus]
48 changes: 48 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Development Environment Setup

This guide outlines the setup process for our development environment, focusing on packaging and dependency management.
## Info on dev setup
### Commit practices (pre-commit)
we use [pre-commit ](https://pre-commit.com/)to run RUFF.
### Poetry for Packaging and Dependency Management

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.

For the most detailed and up-to-date information, please refer to the [official Poetry 📚](https://python-poetry.org/docs/main/#installation).

### Installing Python CLI Applications Globally with pipx

To ensure that Python CLI applications are installed globally on your system while being isolated in their own virtual environments, we utilize `pipx`.

## Steps to Install pipx and Poetry

1. First, [install pipx](https://pipx.pypa.io/stable/installation/) following the instructions on the official website.
2. Once pipx is installed, you can easily install Poetry by running the following command in your terminal:
```pipx install poetry```
3. (*optional*) [install](vscode:extension/zeshuaro.vscode-python-poetry) vscode extension for poetry
### Setup with Poetry
```shell
poetry install
```
### publishing with poetry
https://python-poetry.org/docs/repositories/
## Remarks for devcontainer

You can also work inside a docker container(devcontainer).
To make sure you have access/permissions inside the devcontainer.
From inside the devcontainer after launch, check user and take ownership:

```bash
whoami
sudo chown -R $USER:$USER /workspaces/ -R
```

other option is to run as root from within the `devcontainer.json` `"remoteUser": "root"`

# Useful commands for dev work
## clean up
[vulture](https://github.com/jendrikseipp/vulture) for finding dead python 🐍
```pipx run vulture . --exclude venv```

[deptry](https://github.com/fpgmaas/deptry) for checking dependencies
```pipx run deptry . --ignore-notebooks```
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# OpenEnergyID

Open Source Python library for energy data analytics and simulations

[*more info for developers*](DEVELOPERS.md)
Loading

0 comments on commit a1fafd7

Please sign in to comment.