Repository navigation
Add support for YAML, TOML & JSON - #182
Conversation
3e0e4a9 to
075236b
Compare
hemildesai
left a comment
There was a problem hiding this comment.
Can you add tests to ensure that the coverage stays within 1-2% of main? You can view this PR's coverage at https://github.com/NVIDIA/NeMo-Run/actions/runs/14054878771/job/39352052848?pr=182 and current coverage at https://app.codecov.io/gh/NVIDIA/NeMo-Run
PS I will add a check for this in the future
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
1bd715d to
cb2b6f6
Compare
| from nemo_run.core.execution.base import Executor | ||
| from nemo_run.core.frontend.console.styles import BOX_STYLE, TABLE_STYLES | ||
| from nemo_run.lazy import LazyEntrypoint | ||
| from nemo_run.cli.config import ConfigSerializer |
Check notice
Code scanning / CodeQL
Cyclic import
Copilot Autofix
AI over 1 year ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| from nemo_run.core.frontend.console.styles import BOX_STYLE, TABLE_STYLES | ||
| from nemo_run.lazy import LazyEntrypoint | ||
| from nemo_run.cli.config import ConfigSerializer | ||
| from nemo_run.cli.lazy import LazyEntrypoint |
Check notice
Code scanning / CodeQL
Cyclic import
Copilot Autofix
AI over 1 year ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| import yaml | ||
| from fiddle._src import config as config_lib | ||
|
|
||
| from nemo_run.core.serialization.yaml import YamlSerializer |
Check notice
Code scanning / CodeQL
Cyclic import
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the cyclic import issue, we need to break the cycle by refactoring the code. One effective way to do this is to move the YamlSerializer class to a new module that can be imported by both nemo_run.cli.config and nemo_run.core.serialization.yaml without causing a cyclic dependency. This approach maintains the existing functionality while resolving the cyclic import.
- Create a new module, e.g.,
nemo_run.core.serialization.yaml_serializer, and move theYamlSerializerclass to this new module. - Update the import statements in both
nemo_run.cli.configandnemo_run.core.serialization.yamlto importYamlSerializerfrom the new module.
| @@ -22,3 +22,3 @@ | ||
|
|
||
| from nemo_run.core.serialization.yaml import YamlSerializer | ||
| from nemo_run.core.serialization.yaml_serializer import YamlSerializer | ||
|
|
| Raises: | ||
| ValueError: If the file path is invalid or the file doesn't exist | ||
| """ | ||
| from nemo_run.cli.config import ConfigSerializer |
Check notice
Code scanning / CodeQL
Cyclic import
Copilot Autofix
AI over 1 year ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| A Buildable object (Config or Partial). | ||
| """ | ||
| from nemo_run.cli.cli_parser import parse_cli_args | ||
| from nemo_run.cli.lazy import dictconfig_to_dot_list |
Check notice
Code scanning / CodeQL
Cyclic import
Copilot Autofix
AI over 1 year ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
| _get_return_type, | ||
| ) | ||
| from test.dummy_factory import DummyModel, dummy_entrypoint | ||
| import nemo_run.cli.cli_parser # Import the module to mock its function |
Check notice
Code scanning / CodeQL
Unused import
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we need to remove the unused import statement. This will clean up the code and remove the unnecessary dependency. The best way to fix this is to delete the line that imports nemo_run.cli.cli_parser.
| @@ -46,3 +46,3 @@ | ||
| from test.dummy_factory import DummyModel, dummy_entrypoint | ||
| import nemo_run.cli.cli_parser # Import the module to mock its function | ||
|
|
||
|
|
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
| import_module, | ||
| _load_entrypoint_from_script, | ||
| ) | ||
| from test.dummy_factory import DummyModel # noqa: F401 |
Check notice
Code scanning / CodeQL
Unused import
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we need to remove the unused import statement. This will clean up the code and remove the unnecessary dependency. Specifically, we will delete the line from test.dummy_factory import DummyModel from the file test/cli/test_lazy.py.
| @@ -31,3 +31,3 @@ | ||
| ) | ||
| from test.dummy_factory import DummyModel # noqa: F401 | ||
|
|
||
| import nemo_run.cli.api as api # Import the api module |
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
Signed-off-by: Marc Romeyn <mromeijn@nvidia.com>
This PR enhances the NeMo Run CLI with improved support for configuration file formats, providing more flexible and powerful ways to manage experiments.
Key Improvements:
@syntax--to-yaml,--to-toml, and--to-jsonflagsExamples