NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.21k stars 618 forks source link

CI failure in tests/test_get_epsilon_grid #2855

Closed stevengj closed 3 months ago

stevengj commented 3 months ago

I'm currently seeing failures like:

FAIL: tests/test_get_epsilon_grid
=================================

Traceback (most recent call last):
  File "/home/runner/work/meep/meep/build/meep-1.30.0-beta/_build/sub/python/../../../python/tests/test_get_epsilon_grid.py", line 3, in <module>
    import meep.adjoint as mpa
  File "/home/runner/work/meep/meep/build/meep-1.30.0-beta/_build/sub/python/meep/adjoint/__init__.py", line 13, in <module>
    from .optimization_problem import OptimizationProblem
  File "/home/runner/work/meep/meep/build/meep-1.30.0-beta/_build/sub/python/meep/adjoint/optimization_problem.py", line 5, in <module>
    from autograd import grad, jacobian
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/autograd/__init__.py", line 2, in <module>
    from .differential_operators import (
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/autograd/differential_operators.py", line 16, in <module>
    import autograd.numpy as np
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/autograd/numpy/__init__.py", line 5, in <module>
    from . import numpy_vjps
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/autograd/numpy/numpy_vjps.py", line 563, in <module>
    defvjp(anp.msort, grad_sort)  # Until multi-D is allowed, these are the same.
           ^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/autograd/tracer.py", line 48, in f_wrapped
    return f_raw(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/numpy/__init__.py", line 410, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'msort'. Did you mean: 'sort'?

Seems to be an autograd change that has broken things.

oskooi commented 3 months ago

I pointed out the cause of this error which is indeed related to Autograd in #2792 (comment).

stevengj commented 3 months ago

Oh, so we just need to wait for a new autograd release to make its way to the CI servers?

That might take a while. Maybe in the meantime we can tell CI to install an older version of numpy?