Skip to content

auto-inferred parameters#934

Draft
PythonFZ wants to merge 15 commits into
mainfrom
auto-infer-deps-params
Draft

auto-inferred parameters#934
PythonFZ wants to merge 15 commits into
mainfrom
auto-infer-deps-params

Conversation

@PythonFZ
Copy link
Copy Markdown
Member

@PythonFZ PythonFZ commented Aug 7, 2025

  • test that loading parameters from file actually works as well

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 7, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch auto-infer-deps-params

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 7, 2025

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
248 3 245 29
View the top 3 failed test(s) by shortest run time
tests/integration/test_plugins_mlflow.py::test_mlflow_plotting
Stack Traces | 8.26s run time
mlflow_proj_path = PosixPath('.../pytest-of-runner/pytest-0/test_mlflow_plotting0')

    def test_mlflow_plotting(mlflow_proj_path):
        proj = zntrack.Project()
    
        with proj:
            node = RangePlotter(start=0, stop=10)
    
        proj.build()
        proj.repro(build=False)
    
        with node.state.plugins["MLFlowPlugin"]:
            pass  # load run_id states
    
        child_run_id = node.state.plugins["MLFlowPlugin"].child_run_id
        parent_run_id = node.state.plugins["MLFlowPlugin"].parent_run_id
    
        assert child_run_id is not None
        assert parent_run_id is not None
    
        run = mlflow.get_run(child_run_id)
        # assert params are logged
>       assert run.data.params == {"start": "0", "stop": "10"}
E       AssertionError: assert {} == {'start': '0', 'stop': '10'}
E         
E         Right contains 2 more items:
E         {'start': '0', 'stop': '10'}
E         
E         Full diff:
E         + {}
E         - {
E         -     'start': '0',
E         -     'stop': '10',
E         - }

.../tests/integration/test_plugins_mlflow.py:150: AssertionError
tests/integration/test_plugins_mlflow.py::test_dataclass_deps
Stack Traces | 8.61s run time
mlflow_proj_path = PosixPath('.../pytest-of-runner/pytest-0/test_dataclass_deps0')

    def test_dataclass_deps(mlflow_proj_path):
        t1 = T1(temperature=1)
        t2 = T2(temperature=1)
    
        with zntrack.Project() as proj:
            md = MD(t=t1)
    
        proj.repro()
    
        with md.state.plugins["MLFlowPlugin"]:
            run = mlflow.get_run(md.state.plugins["MLFlowPlugin"].child_run_id)
    
        assert (
>           run.data.params["t"] == "[{'temperature': 1, '_cls': 'test_plugins_mlflow.T1'}]"
        )
E       KeyError: 't'

.../tests/integration/test_plugins_mlflow.py:315: KeyError
tests/integration/test_plugins_mlflow.py::test_mlflow_metrics
Stack Traces | 9.73s run time
mlflow_proj_path = PosixPath('.../pytest-of-runner/pytest-0/test_mlflow_metrics0')

    def test_mlflow_metrics(mlflow_proj_path):
        proj = zntrack.Project()
    
        with proj:
            node = zntrack.examples.ParamsToMetrics(params={"loss": 0})
    
        proj.build()
        # there should be no entry in the mlflow server
    
        proj.repro(build=False)
        # # the run should be there
    
        with node.state.plugins["MLFlowPlugin"]:
            pass  # load run_id states
    
        child_run_id = node.state.plugins["MLFlowPlugin"].child_run_id
        parent_run_id = node.state.plugins["MLFlowPlugin"].parent_run_id
    
        assert child_run_id is not None
        assert parent_run_id is not None
    
        run = mlflow.get_run(child_run_id)
        # assert params are logged
>       assert run.data.params == {"params": "{'loss': 0}"}  # this is strange!
E       assert {} == {'params': "{'loss': 0}"}
E         
E         Right contains 1 more item:
E         {'params': "{'loss': 0}"}
E         
E         Full diff:
E         + {}
E         - {
E         -     'params': "{'loss': 0}",
E         - }

.../tests/integration/test_plugins_mlflow.py:111: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 7, 2025

Benchmark

Write: Varying number of nodes

Write: Varying number of edges

Comment thread zntrack/plugins/dvc_plugin/params.py Outdated
@PythonFZ PythonFZ force-pushed the auto-infer-deps-params branch from d845b9c to 4931faa Compare August 8, 2025 07:11
Comment thread zntrack/node.py
Comment on lines +194 to +199
self._protected_ = set(self._protected_) | {
"nwd",
"name",
"state",
"always_changed",
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not work and can break certain features

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.

1 participant