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

Modernize the code a little #45

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Modernize the code a little #45

wants to merge 8 commits into from

Conversation

timj
Copy link
Member

@timj timj commented Aug 19, 2024

  • Supports python 3.13 and numpy 2
  • Starts dropping python 2 and pyfits support.

The libyaml detection doesn't seem to work (and doesn't work on the master branch with python 3.11) and there is a test failure on master even before this work:

======================================================================
FAIL: test_ZoomMap (__main__.TestAst.test_ZoomMap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/timj/work/starlink-pyast/starlink/ast/test/test.py", line 180, in test_ZoomMap
    self.assertEqual(zoommap.Nobject, 1, str(zoommap))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 3 != 1 :  Begin ZoomMap 	# Zoom about the origin
    Nin = 1 	# Number of input coordinates
 IsA Mapping 	# Mapping between coordinate systems
    Zoom = 1.2 	# Zoom factor
 End ZoomMap

With python 3.13 there is a new warning:

starlink/ast/test/test.py::TestAst::test_MyChannel
  /Users/timj/work/tmp/py13/lib/python3.13/site-packages/_pytest/unraisableexception.py:85: PytestUnraisableExceptionWarning: Exception ignored in PyObject_HasAttrString(); consider using PyObject_HasAttrStringWithError(), PyObject_GetOptionalAttrString() or PyObject_GetAttrString(): None
  
  Traceback (most recent call last):
    File "/Users/timj/work/starlink-pyast/starlink/ast/test/test.py", line 950, in test_MyChannel
      channel = starlink.Ast.Channel(ss, ss)
  TypeError: The supplied 'source' object does not have an 'astsource' method and is not a sequence.

@timj
Copy link
Member Author

timj commented Aug 19, 2024

I also ran black and isort on the code and did some automated updates with ruff. Also use context managers for open().

I'l fix the travis and move it to GitHub actions.

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.

1 participant