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

get_field(vtk) function added to get FieldData from VTK #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andresegido
Copy link

Introduced functions 'get_field' and 'field_data' in order to be able to read FieldData from VTK files.

in order to be able to read FieldData from VTK files.
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this contribution 🙏! This PR seems to be on the right track. There are some usability issues open (see the comments), and it would be great if you could add some simple tests for the new functionality.

src/ReadVTK.jl Outdated Show resolved Hide resolved
src/ReadVTK.jl Outdated Show resolved Hide resolved
@andresegido
Copy link
Author

Thanks for the suggestions! I just introduced them into my last commit.

src/ReadVTK.jl Outdated Show resolved Hide resolved
@ranocha
Copy link
Member

ranocha commented Oct 4, 2023

Thanks a lot for this contribution 🙏! This PR seems to be on the right track. There are some usability issues open (see the comments), and it would be great if you could add some simple tests for the new functionality.

Thanks a lot also from my side! Could you please add some tests of the new functionality? See test/runtests.jl

@andresegido
Copy link
Author

andresegido commented Oct 4, 2023

Thanks a lot for this contribution 🙏! This PR seems to be on the right track. There are some usability issues open (see the comments), and it would be great if you could add some simple tests for the new functionality.

Thanks a lot also from my side! Could you please add some tests of the new functionality? See test/runtests.jl

Hi! I don't have much experiences writing tests, and much less in Julia; so I'm not sure about where to start...

Also, I did a quick check through the vtk files you use for your tests and none of them have any field data, so using them would not be desirable for such a test.

I have done some work with a dummy vtk file I have locally and it works as expected:

vtk = VTKFile("testing/Wing.vtu")
fieldData = ReadVTK.get_field_data(vtk)
nx = get_data(fieldData["nx"])

In this case, fieldData behaves as a ReadVTK.VTKData and nx reads the expected value.

This might help you appending some field data to one of your vtk files and preparing a test.

@ranocha
Copy link
Member

ranocha commented Oct 5, 2023

The example files are collected in the repository https://github.com/JuliaVTK/ReadVTK_examples. You can open a PR there and upload a new file containing some field data. When that PR is merged, you can update the commit hash in

# Commit in the example file repository for which the test files will be downloaded
# Note: The purpose of using a specific commit hash (instead of `main`) is to be able to tie a given
# version of ReadVTK to a specific version of the test file repository. This way, also tests
# for older ReadVTK releases should continue to work.
TEST_EXAMPLES_COMMIT = "1f961a7ad38e76a8d552b8392d8cd661ab9f79b4"

accordingly and write a proper test here.

@ranocha ranocha linked an issue Feb 21, 2024 that may be closed by this pull request
@sloede sloede mentioned this pull request Feb 26, 2024
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.

How to read FieldData?
3 participants