Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO for ovf and vtk #484

Merged
merged 1 commit into from
Sep 21, 2023
Merged

IO for ovf and vtk #484

merged 1 commit into from
Sep 21, 2023

Conversation

lang-m
Copy link
Member

@lang-m lang-m commented Sep 21, 2023

  • Raise RuntimeError if ndim!=3 (not supported in ovf or vtk RectilinearGrid)
  • Add additional tests
  • Review tests for ndim=3 (no changes)

- Raise `RuntimeError` if `ndim!=3` (not supported in ovf or vtk
RectilinearGrid)
- Add additional tests
- Review tests for `ndim=3` (no changes)
@lang-m lang-m requested a review from samjrholt September 21, 2023 07:16
@lang-m lang-m mentioned this pull request Sep 21, 2023
4 tasks
@github-actions
Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Adding dimensionality checks for OVF and VTK file conversions
  • 📝 PR summary: This PR adds checks to ensure that only 3-dimensional fields are converted to OVF and VTK file formats. It raises a RuntimeError if the field's dimensionality is not 3. The PR also includes additional tests for these changes.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: Yes
  • ⏱️ Estimated effort to review [1-5]: 2
    The PR is relatively straightforward, adding dimensionality checks and corresponding tests. However, it requires some knowledge of the OVF and VTK file formats and how they interact with the field's dimensionality.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR is well-structured and the changes are clear. The added dimensionality checks improve the robustness of the code, preventing potential issues when trying to convert fields of unsupported dimensions to OVF or VTK formats. The added tests also ensure that these changes work as expected.

  • 🤖 Code feedback:

    • relevant file: discretisedfield/field.py
      suggestion: Consider adding a comment explaining why only 3-dimensional fields are supported for conversion to VTK. This could help future contributors understand the reasoning behind this limitation. [medium]
      relevant line: "+ if self.mesh.region.ndim != 3:"

    • relevant file: discretisedfield/io/ovf.py
      suggestion: Similar to the previous suggestion, consider adding a comment explaining why only 3-dimensional fields are supported for conversion to OVF. [medium]
      relevant line: "+ if self.mesh.region.ndim != 3:"

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (12b26c7) 93.38% compared to head (7ff1052) 93.39%.
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #484   +/-   ##
=======================================
  Coverage   93.38%   93.39%           
=======================================
  Files          28       28           
  Lines        3040     3044    +4     
=======================================
+ Hits         2839     2843    +4     
  Misses        201      201           
Files Changed Coverage Δ
discretisedfield/field.py 87.11% <100.00%> (+0.03%) ⬆️
discretisedfield/io/ovf.py 98.27% <100.00%> (+0.03%) ⬆️
discretisedfield/io/vtk.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samjrholt samjrholt merged commit f8c4568 into master Sep 21, 2023
@samjrholt
Copy link
Member

@lang-m can both vtk and ovh handle any nvdim? Do we test for this?

@lang-m
Copy link
Member Author

lang-m commented Sep 21, 2023

Discussed in person: nvdims are not fixed to 3 and this is also tested

@lang-m lang-m deleted the test-omf-vtk-wrong-ndim branch June 9, 2024 11:59
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.

3 participants