Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
name: Docs

on:
push:
branches:
- main
workflow_dispatch:


permissions:
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install
run: uv python install 3.12
- name: Install the project
run: |
uv sync --all-extras --dev
- name: Runs tests
run: |
uv run pytest ./tests
run: uv sync --extra docs
- name: Sphinx build
run: |
uv run sphinx-build -M html docs/source docs/build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: uv run sphinx-build -M html docs/source docs/build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true
path: docs/build/html
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
64 changes: 47 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests
name: CI

on:
push:
Expand All @@ -9,23 +9,49 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install lint dependencies
run: uv sync --extra lint
- name: Run ruff linter
run: uv run ruff check ./idessem
- name: Run ruff formatter (check only)
run: uv run ruff format --check ./idessem

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install lint dependencies
run: uv sync --extra lint
- name: Run mypy type checker
run: uv run mypy ./idessem

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: |
uv sync --all-extras --dev
- name: Runs tests
run: |
uv run pytest --cov-report=xml --cov=idessem ./tests
- name: Install test dependencies
run: uv sync --extra test
- name: Run tests
run: uv run pytest --cov-report=xml --cov=idessem ./tests
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -35,12 +61,16 @@ jobs:
name: codecov-idessem
fail_ci_if_error: true
verbose: true
- name: Static type check
run: |
uv run mypy ./idessem
- name: Linter code check
run: |
uv run ruff check ./idessem
- name: Sphinx build
run: |
uv run sphinx-build -M html docs/source docs/build

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install docs dependencies
run: uv sync --extra docs
- name: Build Sphinx documentation
run: uv run sphinx-build -M html docs/source docs/build
40 changes: 0 additions & 40 deletions .github/workflows/publish.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/idessem
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install 3.12
- name: Validate version matches tag
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
PKG_VERSION=$(uv run python -c "import re; print(re.search(r'__version__ = \"(.+?)\"', open('idessem/__init__.py').read()).group(1))")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)"
exit 1
fi
- name: Install the project
run: uv sync --extra test
- name: Run tests
run: uv run pytest ./tests
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload assets to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "$GITHUB_REF_NAME" > /dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" dist/* --clobber
else
gh release create "$GITHUB_REF_NAME" dist/* --generate-notes
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ instance/
docs/_build/
docs/source/gen_modules/**
docs/source/examples/**
docs/source/sg_execution_times.rst

# PyBuilder
target/
Expand Down
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: local
hooks:
- id: mypy
name: mypy
entry: uv run --no-sync mypy ./idessem
language: system
types: [python]
pass_filenames: false
stages: [manual]
32 changes: 28 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
# v1.1.1
# Changelog

O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/),
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).

## [Nao Publicado]

### Corrigido

- Versão da dependência cfinterface fixada para `>=1.8.0,<=1.8.3`

# v1.1.0
## [1.1.0] - 2026-02-02

### Adicionado

- Inclusão de suporte aos arquivos `PDO_CMOSIST`, `PDO_ELEV` e `PDO_OPER_USIH` (@rdlobato)

### Modificado

- Ajustes de testes e documentação para suporte a pandas `>= 3.0.0`

# v1.0.0
## [1.0.0] - 2025-02-21

### Adicionado

- Primeira major release
- Suporte à leitura da maioria dos arquivos de entrada do modelo DESSEM
- Inclusão de suporte aos arquivos de entrada: `respot.dat` [#77](https://github.com/rjmalves/idessem/issues/77), `deflant.dat` [#76](https://github.com/rjmalves/idessem/issues/76), `areacont.dat` [#75](https://github.com/rjmalves/idessem/issues/75), `dadvaz.dat` [#44](https://github.com/rjmalves/idessem/issues/44) e `desselet.dat` [#41](https://github.com/rjmalves/idessem/issues/41)
- Inclusão de suporte aos arquivos de saída: `log_inviab.dat` [#79](https://github.com/rjmalves/idessem/issues/79), `pdo_cmobar.dat` [#78](https://github.com/rjmalves/idessem/issues/78), `pdo_oper_titulacao_contratos` e `pdo_oper_titulacao_usinas` [#80](https://github.com/rjmalves/idessem/issues/80), `pdo_somflux.dat` [#81](https://github.com/rjmalves/idessem/issues/81)
- Correção na leitura do arquivo de entrada `renovaveis.dat` [#73](https://github.com/rjmalves/idessem/issues/73)
- Inclusão de suporte aos novos campos do arquivo de entrada `operuh.dat`

### Modificado

- Métodos le_arquivo e escreve_arquivo deprecados
- Gestão do projeto através de arquivo `pyproject.toml` em substituição ao par `setup.py` + `requirements.txt`
- Requisito de versão de Python atualizado para `>=3.10`
- Dependência da cfinterface atualizada para [v1.8.0](https://github.com/rjmalves/cfi/releases/tag/v1.8.0)
- Refactor da modelagem utilizada para dados provenientes das LIBS: criado o submódulo `libs`, de forma que o usuário possa realizar a importação com `from idessem.libs import ...`.
- Modelagem de entidades das LIBS não é feita baseada nos arquivos fornecidos nos casos de exemplo das versões do modelo, mas sim baseado nas entidades envolvidas na informação, semelhante à divisão feita no site da documentação oficial [LIBS](https://see.cepel.br/manual/libs/latest/index.html)

### Corrigido

- Correção na leitura do arquivo de entrada `renovaveis.dat` [#73](https://github.com/rjmalves/idessem/issues/73)

[Nao Publicado]: https://github.com/rjmalves/idessem/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/rjmalves/idessem/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/rjmalves/idessem/releases/tag/v1.0.0
Loading