mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 10:29:51 +08:00
Fix cli bug in high version of tyro (#3567)
* limited the tyro version up to 0.9.2 * bump tyro>=0.9.8 * Bump typeguard * Runtime checking with jaxtyping hook instead of typeguard * Fix test for Python >=3.11, caused by missing default_factory --------- Co-authored-by: Brent Yi <yibrenth@gmail.com> Co-authored-by: Justin Kerr <justin.g.kerr@gmail.com>
This commit is contained in:
3 files changed
+10
-9
No files matched your search
@@ -83,7 +83,7 @@ The `NERFSTUDIO_METHOD_CONFIGS` environment variable additionally accepts a func
|
|||||||
```python
|
```python
|
||||||
"""my_method/my_config.py"""
|
"""my_method/my_config.py"""
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass, field
|
||||||
from nerfstudio.engine.trainer import TrainerConfig
|
from nerfstudio.engine.trainer import TrainerConfig
|
||||||
from nerfstudio.plugins.types import MethodSpecification
|
from nerfstudio.plugins.types import MethodSpecification
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ def MyMethodFunc():
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MyMethodClass(MethodSpecification):
|
class MyMethodClass(MethodSpecification):
|
||||||
config: TrainerConfig = TrainerConfig(...)
|
config: TrainerConfig = field(default_factory=lambda: TrainerConfig(...))
|
||||||
description: str = "Custom description"
|
description: str = "Custom description"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -18,7 +18,7 @@ dependencies = [
|
|||||||
"av>=9.2.0",
|
"av>=9.2.0",
|
||||||
"comet_ml>=3.33.8",
|
"comet_ml>=3.33.8",
|
||||||
"cryptography>=38",
|
"cryptography>=38",
|
||||||
"tyro>=0.6.6",
|
"tyro>=0.9.8",
|
||||||
"gdown>=4.6.0",
|
"gdown>=4.6.0",
|
||||||
"ninja>=1.10",
|
"ninja>=1.10",
|
||||||
"h5py>=2.9.0",
|
"h5py>=2.9.0",
|
||||||
@@ -93,7 +93,6 @@ dev = [
|
|||||||
"pre-commit==3.3.2",
|
"pre-commit==3.3.2",
|
||||||
"pytest==7.1.2",
|
"pytest==7.1.2",
|
||||||
"pytest-xdist==2.5.0",
|
"pytest-xdist==2.5.0",
|
||||||
"typeguard==2.13.3",
|
|
||||||
"ruff>=0.6.1",
|
"ruff>=0.6.1",
|
||||||
"sshconf==0.2.5",
|
"sshconf==0.2.5",
|
||||||
"pycolmap>=0.3.0", # NOTE: pycolmap==0.3.0 is not available on newer python versions
|
"pycolmap>=0.3.0", # NOTE: pycolmap==0.3.0 is not available on newer python versions
|
||||||
@@ -146,7 +145,7 @@ include = ["nerfstudio*"]
|
|||||||
"*" = ["*.cu", "*.json", "py.typed", "setup.bash", "setup.zsh"]
|
"*" = ["*.cu", "*.json", "py.typed", "setup.bash", "setup.zsh"]
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "-n=4 --typeguard-packages=nerfstudio --disable-warnings"
|
addopts = "-n=4 --jaxtyping-packages=nerfstudio --disable-warnings"
|
||||||
testpaths = [
|
testpaths = [
|
||||||
"tests",
|
"tests",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ else:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class TestConfigClass(MethodSpecification):
|
class TestConfigClass(MethodSpecification):
|
||||||
config: TrainerConfig = TrainerConfig(
|
config: TrainerConfig = field(
|
||||||
method_name="test-method",
|
default_factory=lambda: TrainerConfig(
|
||||||
pipeline=VanillaPipelineConfig(),
|
method_name="test-method",
|
||||||
optimizers={},
|
pipeline=VanillaPipelineConfig(),
|
||||||
|
optimizers={},
|
||||||
|
)
|
||||||
)
|
)
|
||||||
description: str = "Test description"
|
description: str = "Test description"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user