Releases: Bjarten/early-stopping-pytorch
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.2 (2024-11-11)
Bug Fixes
- fix: manual release and publish workflows with version updates (#35)
What's Changed
Full Changelog: v1.0.1...v1.0.2
v1.0.1
v1.0.1 (2024-11-10)
Bug Fixes
- fix: improve release process and documentation (#34)
Description
This PR improves the release process and documentation by:
- Makes tag pushing explicit in the release workflow
- Fixes version management in semantic release
- Updates README with PyPI installation instructions
Changes
- Added explicit tag pushing parameters to semantic-release workflow
- Updated version management in pyproject.toml:
- Added version_toml configuration
- Changed from dynamic to static versioning
- Set version to match current release (1.0.1)
- Updated README.md:
- Added PyPI installation instructions
- Fixed image URL for PyPI compatibility
- Reorganized installation and usage sections (
f42d5d1
)
- fix: use PyPI trusted publisher authentication (#33)
Updates the GitHub Actions publish workflow to use PyPI's Trusted
Publisher authentication instead of token-based authentication. This
change improves security by:
- Removing the need to store PyPI tokens in GitHub secrets
- Using OpenID Connect (OIDC) for secure authentication
- Leveraging PyPI's recommended authentication method for GitHub Actions
Changes
- Removed token-based authentication (TWINE_USERNAME and TWINE_PASSWORD)
- Added required
id-token: write
permission for OIDC - Switched from manual twine upload to
pypa/gh-action-pypi-publish
action (3a0d9b8
)
v1.0.0
v1.0.0 (2024-10-18)
Breaking
- chore!: rename package, restructure files, and add pip integration (#29)
This update introduces significant changes to the project, including
renaming the package, restructuring the directory, and setting up
automated publishing to PyPI using API tokens.
Key Changes:
- Package Renaming:
- The package has been renamed from
pytorchtools
to
early_stopping_pytorch
for clearer naming and better alignment with
its functionality.
- Directory Restructuring:
- Project files have been reorganized for clarity, with the source code
placed under theearly_stopping_pytorch/
directory in the root of the
project.
- PyPI Integration:
- Added support for automated publishing to PyPI using GitHub Actions.
- API tokens are used for secure publishing, stored as GitHub
Secrets (PYPI_TOKEN
).
Impact:
-
Breaking Changes: Users will need to update their import paths
from:from pytorchtools import EarlyStopping
to:
from early_stopping_pytorch import EarlyStopping
-
New versions will be automatically published to PyPI when a new tag is
pushed, using the API token for authentication. (f9522dd
)
Bug Fixes
- fix: release workflow 2 (#32)
This PR modifies our Semantic Release workflow to ensure it's only
triggered manually:
- Removed automatic trigger on push to main branch
- Retained only the
workflow_dispatch
trigger - Simplified job structure while maintaining all necessary steps and
permissions
These changes provide more control over when releases are created,
allowing us to:
- Prevent unintended automatic releases
- Manually initiate the release process when desired
- Maintain full functionality of the Semantic Release process (
ddc6493
)
- fix: release workflow (#31)
This PR updates our Semantic Release workflow to align with best
practices and official documentation. Key changes include:
- Simplified the workflow to use the official Python Semantic Release
GitHub Action. - Adjusted permissions to ensure proper access for creating releases
and tags. - Updated pyproject.toml to prevent double publishing to PyPI.
These changes aim to:
- Streamline our release process
- Improve reliability and consistency of our versioning (
b291782
)
- fix: add check for NaN validation loss in EarlyStopping (#28)
This PR addresses an issue where EarlyStopping
incorrectly treats
nan
validation losses as an improvement, often caused by exploding
gradients.
Key changes:
- Added
np.isnan(val_loss)
check to ensure thatnan
validation
losses are ignored. - Updated the logic to ensure that the patience counter and model
checkpointing are unaffected bynan
values. - Introduced a new unit test,
test_validation_loss_nan
, to verify that
EarlyStopping
behaves correctly whennan
values are encountered
during training.
Chores
- chore: consolidate version definitions and update release workflow (#30)
This pull request consolidates version definitions and improves the
release workflow to streamline the versioning and publishing processes.
The changes are part of an effort to improve maintainability and ensure
the workflows are efficient and modular.
Changes Made:
-
Consolidated Version Management:
-
Removed duplicate version definitions to maintain a single source of
truth. The version is now only defined in
early_stopping_pytorch/__init__.py
to avoid conflicts. -
Removed the
version
field frompyproject.toml
, as
python-semantic-release
handles versioning automatically. -
Updated Release Workflow:
-
Improved the
Create New Release
workflow by separating the release
process from the publishing process. -
The release process now handles version bumping, tagging, and creating
GitHub releases viapython-semantic-release
. -
New Publish Workflow:
-
A dedicated workflow now handles publishing the package to PyPI when a
new version tag is pushed. -
This ensures a clear separation of responsibilities between creating
releases and publishing to PyPI, reducing complexity. (e79817a
)
Features
- feat(ci): add GitHub Action for Python tests, fix EarlyStopping logic, and add unit tests (#27)
This PR introduces several key changes:
- A GitHub Actions workflow for continuous integration, running tests
across multiple Python versions. - Fixes to the
EarlyStopping
class logic, changingbest_score
to
best_val_loss
to improve clarity and correctness. - A new test suite for the
EarlyStopping
class to ensure its correct
behavior after the logic fix.
Changes:
-
Added Python application tests:
-
A new workflow named "Python Application Tests" runs on GitHub
Actions. -
Tests are executed across multiple Python versions (
3.9
,3.10
,
3.11
,3.12
). -
The workflow is triggered on pushes and pull requests to the
main
branch.- Pip dependencies are cached to optimize performance.
-
Fixed EarlyStopping logic:
-
The variable
best_score
was renamed tobest_val_loss
for clarity,
improving the code's readability and matching the purpose of the
variable. -
Logic for early stopping was updated to properly handle edge cases for
delta and stopping conditions based on validation loss behavior. -
Added Unit Tests for
EarlyStopping
: -
The file
test_early_stopping.py
contains a thorough set of tests
covering:- Initialization and attribute checks.
- Behavior when validation loss improves.
- Handling when validation loss does not improve.
- Proper functionality of patience and delta parameters.
- Edge cases for early stopping triggers and verbose output.
Why this change is important:
- Automates testing across different Python versions to ensure
compatibility and reliability. - Fixes logic issues in the
EarlyStopping
class, making it more robust
and clear. - Ensures the
EarlyStopping
class functions as expected through the
added unit tests. - Improves development velocity by automatically running tests on every
push and pull request. (ffe12ee
)