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

Fix TypeError: loadtxt() got an unexpected keyword argument 'headers' in src/diffpy/pdfmorph/tools.py #144

Closed
bobleesj opened this issue Oct 25, 2024 · 10 comments

Comments

@bobleesj
Copy link
Contributor

Problem

FAILED tests/test_pdfmorphapp.py::TestApp::test_parser_systemexits - TypeError: loadtxt() got an unexpected keyword argument 'headers'
FAILED tests/test_pdfmorphapp.py::TestApp::test_morphsequence - TypeError: loadtxt() got an unexpected keyword argument 'headers'
FAILED tests/test_pdfmorphio.py::TestApp::test_morph_outputs - TypeError: loadtxt() got an unexpected keyword argument 'headers'
FAILED tests/test_tools.py::TestTools::test_field_sort - TypeError: loadtxt() got an unexpected keyword argument 'headers'

Found in

tests/test_tools.py:80: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/diffpy/pdfmorph/tools.py:203: in field_sort
    fhd = parsers.loadData(path, headers=True)
_ _ _ _ _ _

Proposed solution

Investigate the problem a bit more and update here.

@bobleesj
Copy link
Contributor Author

./../../miniconda3/envs/diffpy_utils_env/lib/python3.13/site-packages/diffpy.utils-3.0.0-py3.7.egg/diffpy/utils/parsers/loaddata.py:100: TypeError
==========================

It seems like the error is coming from diffpy.utils

@sbillinge
Copy link
Contributor

@Sparks29032 this might be good once for you?

@Sparks29032
Copy link
Collaborator

Can I have a bit more information about the error... is this Python 3.13?

@Sparks29032
Copy link
Collaborator

Sparks29032 commented Oct 26, 2024

@bobleesj @sbillinge Why are we running diffpy.utils version 3.0.0? This is before we updated loadtxt to parse header information.

Your error message says diffpy.utils-3.0.0-py3.7.egg

@sbillinge
Copy link
Contributor

Yes, not sure why it is loading that?

@sbillinge
Copy link
Contributor

Nothin to fix them except the environment/install?

@Sparks29032
Copy link
Collaborator

Should be the case, passed locally

@sbillinge
Copy link
Contributor

But do we know why CI is loading the wrong version?

@bobleesj
Copy link
Contributor Author

Please see my response here - #143 (comment)

@bobleesj
Copy link
Contributor Author

bobleesj commented Nov 9, 2024

Closing since it correctly installs the diffpy.utils (3.5.0) supporting py.3.13

Test result:

diffpy.pdfmorph/tests/test_version.py .                                                   [  3%]
tests/test_morph_func.py .....                                                            [ 18%]
tests/test_morphchain.py .                                                                [ 21%]
tests/test_morphpdftordf.py .                                                             [ 24%]
tests/test_morphrdftopdf.py .                                                             [ 27%]
tests/test_morphresolution.py .                                                           [ 30%]
tests/test_morphrgrid.py ....                                                             [ 42%]
tests/test_morphscale.py .                                                                [ 45%]
tests/test_morphshape.py ..                                                               [ 51%]
tests/test_morphsmear.py .                                                                [ 54%]
tests/test_morphstretch.py .                                                              [ 57%]
tests/test_pdfmorphapp.py ...                                                             [ 66%]
tests/test_pdfmorphio.py .                                                                [ 69%]
tests/test_pdfplot.py .                                                                   [ 72%]
tests/test_refine.py ...                                                                  [ 81%]
tests/test_tools.py .....                                                                 [ 96%]
tests/test_version.py .                                                                   [100%]

====================================== 33 passed in 25.21s =====================================

imac@imacs-iMac diffpy.pdfmorph % python --version
Python 3.13.0

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

No branches or pull requests

3 participants