Repository navigation
Update of package for newer python versions (python 3.10 and above) - #26
Merged
Merged
Conversation
- 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.
chrisbrand-droid
marked this pull request as draft
November 6, 2026 15:55
chrisbrand-droid
marked this pull request as ready for review
November 6, 2026 15:58
Collaborator
Author
|
Update: Formatting changes and requirement updates to fix test failures on previous pull request and some warnings.
Warnings:
Cosmetic changes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the following files:
import pkg_resourceswas deprecated and removed in Python 3.12. The code was updated to reflect this change by removing the import statement and any references topkg_resourcesin the setup.py file. Now it takes the lines directly from the requirements.txt file without usingpkg_resources.numpy.math.factorialwas 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.scipy.interpolate.interp1dwas deprecated and removed in Scipy 1.14.0. The code was updated to use the new SciPy interpolatorRegularGridInterpolator, ensuring that the visualization functions continue to work correctly with the latest version of the library.plot_wavelength_vs_distanceandplot_delay_vs_distancetoplot_wavelength_vs_distance_logarithmicandplot_delay_vs_distance_logarithmic) 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.