Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement a fast reading mode. #382

Open
MicahGale opened this issue Mar 4, 2024 · 6 comments
Open

Implement a fast reading mode. #382

MicahGale opened this issue Mar 4, 2024 · 6 comments
Labels
feature request An issue that improves the user interface. performance 🐌 Issues related to speed and memory

Comments

@MicahGale
Copy link
Collaborator

MicahGale commented Mar 4, 2024

Problem

A common use case of MontePy is model interrogation, where you are interested in just getting a few pieces of data from say one cell.
For large models this isn't very practical as loading the whole model can take upwards of a minute, and makes prototyping the code hard.

Solution

I proposed making a mode to read the input file in which only the objects the user cares about are loaded.

For instance montepy.fast_read(cells={1,2,3})

would only read cells 1,2,3 and their supporting surfaces, materials, transforms, modifiers, etc.

This does present opportunities for doing bad ideas like trying to modify a partially loaded model.

This would require significant work under the hood, and would need to really optimize the process of identifying relevant objects.

@MicahGale MicahGale added the feature request An issue that improves the user interface. label Mar 4, 2024
@tjlaboss
Copy link
Collaborator

tjlaboss commented Aug 2, 2024

A "fast-read, read-only" mode would be extremely useful.

@MicahGale
Copy link
Collaborator Author

What do you mean by read-only here?

@tjlaboss
Copy link
Collaborator

tjlaboss commented Aug 5, 2024

Because...

This does present opportunities for doing bad ideas like trying to modify a partially loaded model.

...then, having a partially loaded model that the user cannot modify makes sense. It might be too annoying to make read-only versions of objects, though. It might be better to just make it the user's responsibility not to do bad ideas.

@MicahGale
Copy link
Collaborator Author

Yeah... I think just a lot of warnings in the documentation is the way to go.

@tjlaboss tjlaboss added the performance 🐌 Issues related to speed and memory label Aug 27, 2024
@tjlaboss
Copy link
Collaborator

Idea from our meeting with @dodu94: on-the-fly parsing

@MicahGale
Copy link
Collaborator Author

I'll open an issue about it

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request An issue that improves the user interface. performance 🐌 Issues related to speed and memory
Projects
None yet
Development

No branches or pull requests

2 participants