Skip to content

Stoch file plotting tool#98

Merged
lispandfound merged 15 commits intomasterfrom
stoch
Apr 6, 2025
Merged

Stoch file plotting tool#98
lispandfound merged 15 commits intomasterfrom
stoch

Conversation

@lispandfound
Copy link
Contributor

Adds a plot-stoch tool to plot the contents of a stoch file for workflow validation. I've also added a simple regression test and a wiki entry describing how to use it.

@sungeunbae
Copy link
Member

==================================== ERRORS ====================================
_____________________ ERROR collecting tests/test_plots.py _____________________
ImportError while importing test module '/home/jenkins/workspace/visualisation/tests/test_plots.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_plots.py:7: in <module>
    from visualisation.sources import (
visualisation/sources/plot_stoch.py:12: in <module>
    from source_modelling import stoch
E   ImportError: cannot import name 'stoch' from 'source_modelling' (/home/jenkins/workspace/visualisation/.venv/lib/python3.13/site-packages/source_modelling/__init__.py)

@lispandfound
Copy link
Contributor Author

==================================== ERRORS ====================================
_____________________ ERROR collecting tests/test_plots.py _____________________
ImportError while importing test module '/home/jenkins/workspace/visualisation/tests/test_plots.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_plots.py:7: in <module>
    from visualisation.sources import (
visualisation/sources/plot_stoch.py:12: in <module>
    from source_modelling import stoch
E   ImportError: cannot import name 'stoch' from 'source_modelling' (/home/jenkins/workspace/visualisation/.venv/lib/python3.13/site-packages/source_modelling/__init__.py)

Yeah that's because it requires the stoch module in source modelling. Since that PR has merged now it should work.

@lispandfound lispandfound requested a review from Copilot March 28, 2025 02:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a new tool, plot-stoch, for plotting the contents of stoch files to aid in workflow validation, along with a corresponding regression test and wiki documentation update.

  • Added a new wiki section documenting the plot-stoch tool usage.
  • Introduced the plot_stoch.py module with functions to generate stoch plots.
  • Added a regression test to validate plot-stoch tool functionality.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

File Description
wiki/Sources.md Added documentation for plotting stoch files in the wiki.
visualisation/sources/plot_stoch.py Introduced plot_stoch tool implementation and CLI command.
tests/test_plots.py Added regression test for the plot-stoch tool.
pyproject.toml Registered the plot-stoch tool with the CLI entry point.
Files not reviewed (1)
  • tests/stoch/realisation.stoch: Language not supported

@lispandfound lispandfound requested a review from Copilot March 31, 2025 21:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new command-line tool, plot-stoch, to visualize stoch files, updating the documentation, implementation, and regression tests accordingly.

  • Added a new plotting tool in visualisation/sources/plot_stoch.py for stoch files.
  • Updated documentation in wiki/Sources.md and registered the new tool in pyproject.toml.
  • Added regression test coverage for the new tool in tests/test_plots.py.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

File Description
wiki/Sources.md Added documentation for plotting stoch files.
visualisation/sources/plot_stoch.py Introduced the plot_stoch tool implementation and CLI interface.
tests/test_plots.py Added regression tests for the plot_stoch tool.
pyproject.toml Registered the new plot-stoch command.
Files not reviewed (1)
  • tests/stoch/realisation.stoch: Language not supported
Comments suppressed due to low confidence (1)

visualisation/sources/plot_stoch.py:65

  • The parameter 'width' is re-assigned in this function, shadowing its original value. Consider renaming the computed width (e.g., to 'plot_width') to avoid confusion with the CLI parameter.
width = dy * slip.shape[0]

lispandfound and others added 2 commits April 1, 2025 10:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lispandfound lispandfound merged commit bcf1d16 into master Apr 6, 2025
5 checks passed
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.

5 participants