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 docstring example syntax errors and test Python 3.9 #195

Conversation

sadielbartholomew
Copy link
Member

@sadielbartholomew sadielbartholomew commented Mar 18, 2021

Closes #132.

Now the linting pre-commit checks are passing after #194, I want to check if Python 3.9 passes the CI to confirm the resolution of #132. It passes for me locally as far as I can tell around the seg faults which are still occurring and under investigation (see #180), though the seg faults may also appear on the Actions jobs since we have seen them emerge there before.

Since the Actions jobs for the workflow to run the test suite are only set to be triggered by PR, I am putting in a trivial PR to trigger and inspect the jobs. These trivial commits fix all of the syntax errors raised by doctest on the codebase (I have set up a CLI option -d so we can check these via py run_tests.py -d towards #4, though until they are all passing I won't add them to the test suite).

@sadielbartholomew
Copy link
Member Author

sadielbartholomew commented Mar 18, 2021

Results are in... both the standard codebase-based (with 3.9) and the source dist (with 3.7) test jobs have failed (else been cancelled) due to one test method error emerging due to some spurious partitioning-based issue:

======================================================================
ERROR: test_Field_indices (test_Field.FieldTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cf-python/cf-python/main/cf/test/test_Field.py", line 1490, in test_Field_indices
    indices = f.indices(grid_longitude=cf.wi(50, 130))
  File "/home/runner/work/cf-python/cf-python/main/cf/field.py", line 13194, in indices
    b = self.flip(axis).anchor(axis, anchor1, dry_run=True)[
  File "/home/runner/work/cf-python/cf-python/main/cf/decorators.py", line 64, in precede_with_kwarg_deprecation_check
    operation_method_result = operation_method(self, *args, **kwargs)
  File "/home/runner/work/cf-python/cf-python/cfdm/cfdm/decorators.py", line 49, in inplace_wrapper
    processed_copy = operation_method(self, *args, **kwargs)
  File "/home/runner/work/cf-python/cf-python/main/cf/field.py", line 15527, in anchor
    if dim.increasing:
  File "/home/runner/work/cf-python/cf-python/main/cf/dimensioncoordinate.py", line 259, in increasing
    return self.direction()
  File "/home/runner/work/cf-python/cf-python/main/cf/dimensioncoordinate.py", line 359, in direction
    _direction = self._infer_direction()
  File "/home/runner/work/cf-python/cf-python/main/cf/dimensioncoordinate.py", line 129, in _infer_direction
    data = data[0:2].array
  File "/home/runner/work/cf-python/cf-python/main/cf/data/data.py", line 7921, in array
    p_array = partition.array
  File "/home/runner/work/cf-python/cf-python/main/cf/data/partition.py", line 1153, in array
    p_data = p_data.reshape(p_shape)
ValueError: cannot reshape array of size 9 into shape (1,)

----------------------------------------------------------------------
Ran 304 tests in 1246.062s

FAILED (errors=1)

@davidhassell should we be concerned about that error now, or assume it is some unknown facet of the partitioning that has been there for a long time as I believe we agreed last time?

The great news is no seg faults are happening (at least for the jobs that ran to completion and for the tests that ran before the cancellations otherwise)! Which is great as even with faulthandler it's difficult to diagnose and debug those.

Since the 3.9 test is passing beside the above test method in a way that is consistent with the jobs with the other minor Python versions, I am satisfied that 3.9 is running fine on the CI as well as locally. Hence:

@sadielbartholomew sadielbartholomew merged commit 1bb6218 into NCAS-CMS:master Mar 18, 2021
@sadielbartholomew sadielbartholomew deleted the docstring-example-syntaxerrors branch May 27, 2021 00:09
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.

Verify support for Python 3.9 (once it is more established)
1 participant