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

PVD collection: Consider full path to vtk instead of just the filename #52

Merged
merged 2 commits into from
Jul 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gridtypes/ParaviewCollection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function collection_add_timestep(pvd::CollectionFile, datfile::VTKFile,
xroot = root(pvd.xdoc)
xMBDS = find_element(xroot, "Collection")
xDataSet = new_child(xMBDS, "DataSet")
fname = splitdir(datfile.path)[2]
fname = relpath(datfile.path |> abspath ,pvd.path |> abspath |> splitdir |> first)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe

Suggested change
fname = relpath(datfile.path |> abspath ,pvd.path |> abspath |> splitdir |> first)
fname = relpath(abspath(datfile.path), first(splitdir(abspath(pvd.path))))

to follow the style of the rest of the code? :)

Copy link
Member

Choose a reason for hiding this comment

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

Perfect, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also fine. I just like the clean look you get when using |>

Copy link
Contributor

@fredrikekre fredrikekre Jul 17, 2019

Choose a reason for hiding this comment

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

I just like the clean look you get when using |>

Well, I like the clean look you get when you don't use it :)

set_attribute(xDataSet, "timestep", string(t))
set_attribute(xDataSet, "part", "0")
set_attribute(xDataSet, "file", fname)
Expand Down