Skip to content

Release new version? (incompatibility with numpy>=2) #60

@kavanase

Description

@kavanase

I got this traceback when trying to use the latest version of galore:

Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 52, in get_cross_sections
    return get_cross_sections_scofield(energy, elements=elements)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 281, in get_cross_sections_scofield
    orb: _eval_fit(energy, np_fromstr(coeffs))
                           ~~~~~~~~~~^^^^^^^^
ValueError: The binary mode of fromstring is removed, use frombuffer instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/bin/galore", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 55, in main
    run(**args)
    ~~~^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 71, in run
    pdos_from_files(**kwargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 85, in pdos_from_files
    pdos_plotting_data = galore.process_pdos(**kwargs)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/__init__.py", line 244, in process_pdos
    cross_sections = galore.get_cross_sections(weighting,
                                               elements=pdos_data.keys())
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 64, in get_cross_sections
    return get_cross_sections_json(weighting)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 142, in get_cross_sections_json
    raise IOError("Cross-sections file {0} does not "
                  "exist!".format(path))
OSError: Cross-sections file 5 does not exist!
Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 52, in get_cross_sections
    return get_cross_sections_scofield(energy, elements=elements)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 281, in get_cross_sections_scofield
    orb: _eval_fit(energy, np_fromstr(coeffs))
                           ~~~~~~~~~~^^^^^^^^
ValueError: The binary mode of fromstring is removed, use frombuffer instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/bin/galore", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 55, in main
    run(**args)
    ~~~^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 71, in run
    pdos_from_files(**kwargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 85, in pdos_from_files
    pdos_plotting_data = galore.process_pdos(**kwargs)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/__init__.py", line 244, in process_pdos
    cross_sections = galore.get_cross_sections(weighting,
                                               elements=pdos_data.keys())
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 64, in get_cross_sections
    return get_cross_sections_json(weighting)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 142, in get_cross_sections_json
    raise IOError("Cross-sections file {0} does not "
                  "exist!".format(path))
OSError: Cross-sections file 5 does not exist!
Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 52, in get_cross_sections
    return get_cross_sections_scofield(energy, elements=elements)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 281, in get_cross_sections_scofield
    orb: _eval_fit(energy, np_fromstr(coeffs))
                           ~~~~~~~~~~^^^^^^^^
ValueError: The binary mode of fromstring is removed, use frombuffer instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/bin/galore", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 55, in main
    run(**args)
    ~~~^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 71, in run
    pdos_from_files(**kwargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cli/galore.py", line 85, in pdos_from_files
    pdos_plotting_data = galore.process_pdos(**kwargs)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/__init__.py", line 244, in process_pdos
    cross_sections = galore.get_cross_sections(weighting,
                                               elements=pdos_data.keys())
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 64, in get_cross_sections
    return get_cross_sections_json(weighting)
  File "/Users/kavanase/miniconda3/lib/python3.13/site-packages/galore/cross_sections.py", line 142, in get_cross_sections_json
    raise IOError("Cross-sections file {0} does not "
                  "exist!".format(path))
OSError: Cross-sections file 5 does not exist!

I think it's related to the numpy version – I'm using 2.3.3. Many computational materials science packages are now based on numpy>=2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions