mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-09-13 12:40:59 +08:00
Adding a test for generator support (#171)
* Add a test for generators * Remove output annotations from decorators Also guarded torch imports for better compatibility with requirements.txt * Add flag to the main meta class to skip the typecheck * Return to the old solution * Make async tests work * Minor adjustments/fixing typos * Correct Python path for new tests * Remove some jax-dependent code * Implement equality for MetaArrays * Make all Dim variations frozen dataclasses * Shorten AbstractArray methods * Final touches * Removing get_origin use * Update tests with @jaxtyp
This commit is contained in:
committed by
Patrick Kidger
parent
17ea4b13eb
commit
172b83b4fc
@@ -1,9 +1,14 @@
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
_py_path = sys.executable
|
||||
|
||||
|
||||
def test_no_jax_dependency():
|
||||
result = subprocess.run(
|
||||
"python -c 'import jaxtyping; import sys; sys.exit(\"jax\" in sys.modules)'",
|
||||
f"{_py_path} -c "
|
||||
"'import jaxtyping; import sys; sys.exit(\"jax\" in sys.modules)'",
|
||||
shell=True,
|
||||
)
|
||||
assert result.returncode == 0
|
||||
@@ -13,7 +18,7 @@ def test_no_jax_dependency():
|
||||
# subprocess.)
|
||||
def test_meta():
|
||||
result = subprocess.run(
|
||||
"python -c 'import jaxtyping; import jax; import sys; "
|
||||
f"{_py_path} -c 'import jaxtyping; import jax; import sys; "
|
||||
'sys.exit("jax" in sys.modules)\'',
|
||||
shell=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user