10000 Loading of data collections by najlkin · Pull Request #332 · GLVis/glvis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Loading of data collections #332

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

Merged
merged 23 commits into from
Apr 29, 2025
Merged

Loading of data collections #332

merged 23 commits into from
Apr 29, 2025

Conversation

najlkin
Copy link
Contributor
@najlkin najlkin commented Apr 19, 2025

This PR introduces loading of data collections following #325 and refactors the codebase. All collections with implemented readers in MFEM are supported, i.e., VisIt, Sidre, FMS, Conduit. The path to the collection is specified by -visit/-sidre/-fms/-conduit parameter and the name of the field through -g or q-field through -q. Optionally, the cycle and protocol can be specified through dc-cycle and dc-prot respectively.

Alternatively, scripts can be used for loading. The commands are data_coll_mesh/field/quad, where the first parameter is the integer corresponding to the type of the collection matching DataCollectionReader::CollType. The cycle and protocol can be preset by data_coll_cycle/protocol.

Corresponding website update: GLVis/web#18

@najlkin najlkin added this to the glvis-4.4 milestone Apr 19, 2025
@najlkin najlkin self-assigned this Apr 19, 2025
@najlkin najlkin mentioned this pull request Apr 22, 2025
20 tasks
@najlkin najlkin changed the title [WIP] Loading of data collections Loading of data collections Apr 22, 2025
@najlkin najlkin requested a review from justinlaughlin April 22, 2025 23:23
@najlkin
Copy link
Contributor Author
najlkin commented Apr 22, 2025

@justinlaughlin , can you check if glvis-js works? There have been a few small changes in aux_js.cpp.

@tzanio tzanio requested review from tzanio and v-dobrev April 23, 2025 14:44
@tzanio tzanio requested a review from Copilot April 23, 2025 14:44
Copy link
@Copilot 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 refactors the codebase to load data collections by replacing StreamState with a more unified DataState and updating the file and collection readers accordingly. Key changes include:

  • Refactoring threading, stream, and file reading modules to use DataState instead of StreamState.
  • Updating collection reading and JS binding logic to be consistent with the new DataState API.
  • Cleaning up legacy or unused functions (e.g. removal of Set_Texture_Image) for improved maintainability.

Reviewed Changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/threads.hpp & .cpp Replaced StreamState with DataState and updated related API calls
lib/stream_reader.hpp Removed StreamState methods; introduced a StreamReader class to work with DataState
lib/file_reader.[hp cpp]
lib/coll_reader.[hp cpp]
lib/data_state.hpp New unified data state structure replacing StreamState
lib/aux_vis.hpp & aux_js.cpp Updated auxiliary and JavaScript interop functions to work with DataState
Files not reviewed (3)
  • CHANGELOG: Language not supported
  • lib/CMakeLists.txt: Language not supported
  • makefile: Language not supported
Comments suppressed due to low confidence (1)

lib/file_reader.hpp:22

  • [nitpick] The variable 'pad_digits' could be renamed to something more descriptive (e.g., 'file_pad_digits') to clarify its role in formatting file names.
int pad_digits;

@tzanio
Copy link
Member
tzanio commented Apr 23, 2025

That's a really useful capability, thanks @najlkin !

@justinlaughlin
Copy link
Contributor
justinlaughlin commented Apr 24, 2025

@justinlaughlin , can you check if glvis-js works? There have been a few small changes in aux_js.cpp.

I'll check it out

Edit: It built at least :) will see how it runs https://github.com/GLVis/glvis-js/tree/ci-build-14650298946

Edit 2: Tested basic functionality in glvis-js and it seems okay. Having trouble building PyMFEM for PyGLVis atm - I can test more once a couple PRs are merged; we shouldn't hold this up for that though.

@justinlaughlin
Copy link
Contributor

Do you have any files that would be good as test cases? Maybe we can upload to mfem/data

@najlkin
Copy link
Contributor Author
najlkin commented Apr 24, 2025

Just run some of the examples and try to load the output data collections😉 .

@justinlaughlin
Copy link
Contributor

I still think it'd be good to upload some small sample data.

  1. It showcases and give exposure to all of this work, we can point to specific files that it works on and even maybe post some pictures on the site
  2. Having some files in mfem/data also serves a reference point for what version of file formats have been tested (without making a whole new integration test). e.g. newer gmsh versions are not compatible with glvis - if I hadn't checked mfem/data I might have just given up on using glvis for gmsh but instead I realized it works fine if I export as v22)

@justinlaughlin
Copy link
Contributor

This looks very good though! Much cleaner implementation and it is nice to see so many lines of deleted code :)

8000

Copy link
Member
@tzanio tzanio left a comment

Choose a reason for hiding this comment

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

This is a really nice addition, thank you @najlkin. 🚀

I agree with @justinlaughlin that it may be good to add some data collections samples (e.g. the same data from Example 5 or something in different formats) to the mfem/data repo.

lib/palettes.cpp lib/palettes_base.cpp lib/sdl.cpp lib/sdl_helper.cpp lib/sdl_main.cpp \
lib/coll_reader.cpp lib/data_state.cpp lib/file_reader.cpp lib/font.cpp \
lib/gl2ps.c lib/gltf.cpp lib/material.cpp lib/openglvis.cpp lib/palettes.cpp \
lib/palettes_base.cpp lib/sdl.cpp lib/sdl_helper.cpp lib/sdl_main.cpp \
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, the order is the same, right (?). We need to redecorate it after merging this and updating the release branch 🪄 .

@najlkin
Copy link
Contributor Author
najlkin commented Apr 29, 2025

I agree with @justinlaughlin that it may be good to add some data collections samples (e.g. the same data from Example 5 or something in different formats) to the mfem/data repo.

Added some VisIt test files in mfem/data#11 😉 .

@tzanio tzanio merged commit 962cec2 into master Apr 29, 2025
10 checks passed
@tzanio tzanio deleted the load-data-coll branch April 29, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0