Skip to content

Modernize GNLSE for Python 3.14 and tox 4 - #27

Merged
chrisbrand-droid merged 3 commits into
mainfrom
modernize-ci
Nov 12, 2026
Merged

chrisbrand-droid merged 3 commits into
mainfrom
modernize-ci

Conversation

@karoltarnowski

Copy link
Copy Markdown
Contributor

No description provided.

chrisbrand-droid and others added 3 commits November 3, 2026 13:22
- setup.py
    import pkg_resources was deprecated and removed in Python 3.12. The code was updated to reflect this change by removing the import statement and any references to pkg_resources in the setup.py file. Now it takes the lines directly from the requirements.txt file without using pkg_resources.
- gnlse/dispersion.py
    numpy.math.factorial was deprecated and removed in numpy 1.25.0. The code was updated to use the math module instead of numpy for calculating factorials. This change ensures compatibility with newer versions of numpy and avoids potential issues with deprecated functions.
- gnlse/visualization.py
    Scipy.interpolate.interp1d was deprecated and removed in Scipy 1.14.0. The code was updated to use the new SciPy interpolator RegularGridInterpolator, ensuring that the visualization functions continue to work correctly with the latest version of the library.
- examples/test_Dudley.py
    The plotting functions were updated to use logarithmic scales for better visualization of the data to reflect what was plotted in the book Supercontinuum Generation by Dudley and Taylor. The changes include replacing the original plotting functions with their logarithmic counterparts, allowing for a more accurate representation of the results in the plots.
…evious pull request and some warnings.

Changes to requirements.txt to update the minimum version
of numpy, matplotlib, hdf5storage and scipy.

Warnings:
 - visualization.py: in np.log10, added out=None to avoid warnings when the where condition is not met.
 - gnlse.py: in the tqdm progress bar, round the total (fibre length) to avoid warnings when the rounded fraction is greater than the total.
 - plot_input_pulse.py: Changed the plotting to plot the absolute values of the amplitude envelopes to avoid warnings when plotting complex numbers.

Cosmetic changes:
 - Changed to logarithmic plots in test_raman.py to visualise the spectrum better.
 - setup.py: removed commented out code.
 - plot_input_pulse.py: fixed typos in comments.
 - visualization.py: split long line into two lines to avoid line length warnings.

@karoltarnowski karoltarnowski left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

@chrisbrand-droid chrisbrand-droid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me

@chrisbrand-droid
chrisbrand-droid merged commit 214af17 into main Nov 12, 2026
6 checks passed
@chrisbrand-droid
chrisbrand-droid deleted the modernize-ci branch November 12, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants