Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy2 ci #429

Merged
merged 2 commits into from
Mar 6, 2025
Merged

Numpy2 ci #429

merged 2 commits into from
Mar 6, 2025

Conversation

nickjcroucher
Copy link
Owner

Adds patch from @emollier (#426) via a branch to run CI checks.

emollier and others added 2 commits February 28, 2025 10:53
This patch fixes the following symptom when running gubbins with Numpy
version 2 and more:

	Running joint ancestral reconstruction with pyjar
	Traceback (most recent call last):
	  File "/usr/bin/run_gubbins", line 33, in <module>
	    sys.exit(load_entry_point('gubbins==3.4', 'console_scripts', 'run_gubbins.py')())
	             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
	  File "/usr/share/gubbins/gubbins/run_gubbins.py", line 166, in main
	    gubbins.common.parse_and_run(parser.parse_args(), parser.description)
	    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/share/gubbins/gubbins/common.py", line 373, in parse_and_run
	    jar(sequence_names = ordered_sequence_names, # complete polymorphism alignment
	    ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	        base_patterns = base_pattern_bases_array, # array of unique base patterns in alignment
	        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    ...<8 lines>...
	        verbose = input_args.verbose,
	        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	        max_pos = max_pos)
	        ^^^^^^^^^^^^^^^^^^
	  File "/usr/share/gubbins/gubbins/pyjar.py", line 646, in jar
	    node_pij = numpy.full((num_nodes,16), numpy.NINF, dtype=numpy.float32)
	                                          ^^^^^^^^^^
	  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 400, in __getattr__
	    raise AttributeError(
	    ...<3 lines>...
	    )
	AttributeError: `np.NINF` was removed in the NumPy 2.0 release. Use `-np.inf` instead.

Signed-Off-By: Étienne Mollier <[email protected]>
Fix runtime failures with Numpy ≥ 2
@nickjcroucher nickjcroucher merged commit 9ba46de into master Mar 6, 2025
2 checks passed
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