Skip to content

Packaging and numpy>=2#49

Open
benvial wants to merge 12 commits intoImpedanCEI:mainfrom
benvial:numpy2
Open

Packaging and numpy>=2#49
benvial wants to merge 12 commits intoImpedanCEI:mainfrom
benvial:numpy2

Conversation

@benvial
Copy link

@benvial benvial commented Dec 5, 2025

📝 Pull Request Summary

This PR modernizes the wakis project infrastructure by migrating from setup.py to modern Python packaging standards using pyproject.toml. It also adds support for NumPy 2.x by removing version pinning and updating deprecated NumPy APIs. Additionally, it includes comprehensive code formatting and style improvements across the entire codebase using ruff.

🔧 Changes Made

Infrastructure & Packaging:

  • Migrated from setup.py to pyproject.toml for modern Python packaging
  • Removed legacy requirements.txt and docs/requirements.txt in favor of pyproject.toml
  • Updated Makefile with new build and development workflows
  • Enhanced release.sh script for streamlined releases
  • Updated .gitignore and MANIFEST.in for better file management
  • Updated readthedocs.yml configuration

NumPy 2.x Compatibility:

  • Removed NumPy version pinning to allow numpy>=2
  • Replaced deprecated np.string_ with np.bytes_ for NumPy 2.x compatibility
  • Ensured compatibility with both NumPy 1.x and 2.x

Code Quality & Formatting:

  • Applied consistent code formatting across all Python modules in wakis/
  • Reformatted all example scripts in examples/ (wakefield simulations, FDTD, FIT)
  • Updated all Jupyter notebooks in notebooks/ with consistent styling
  • Reformatted all test files in tests/ for improved readability
  • Updated version string in wakis/_version.py

Documentation:

  • Updated docs/conf.py with improved configuration
  • Revised docs/installation.md with modern installation instructions
  • Updated README.md

✅ Checklist

  • Code follows the project's style and guidelines
  • Added tests for new functionality (N/A - formatting/infrastructure changes)
  • Updated documentation (mentioned in docs/ or included in examples/ and notebooks/)
  • Verified that changes do not break existing functionality (automatic tests passing)

📌 Related Issues / PRs
N/A

Note: This PR touches 84 files with significant line changes. The bulk of changes are formatting-related, making the actual functional changes minimal. Please review the pyproject.toml and build system changes carefully.

@elenafuengar elenafuengar added the style Improvements to code quality and readability label Dec 8, 2025
@elenafuengar elenafuengar self-assigned this Dec 8, 2025
@elenafuengar
Copy link
Collaborator

hello Benjamin, thanks a lot for the contribution!!!

I'm also using Ruff as a local linter but haven't dared to reformat all the code accordingly.
The only thing is that I personally don't like too much having the __init__ with one attribute per line, as I find it less readable.

I'll review everything and hopefully merge your changes soon!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this uv.lock used for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv is a Python package manager https://docs.astral.sh/uv/.
I was using it to develop locally but since it is not used in wakis I just added the lockfile to .gitignore (not sure if this should be version controlled generally speaking though)

@elenafuengar
Copy link
Collaborator

Currently the tests are failing since requirements.txt is not longer there and I guess pytest is not explicitly included in the github actions workflow...

@elenafuengar elenafuengar assigned benvial and unassigned elenafuengar Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

style Improvements to code quality and readability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants