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

Default request settings write to .measurement file twice #100

Open
tpitkanen opened this issue Nov 25, 2020 · 2 comments
Open

Default request settings write to .measurement file twice #100

tpitkanen opened this issue Nov 25, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@tpitkanen
Copy link
Member

Description

Both Measurement and Simulation write their data to the same .measurement file. This causes issues when editing request settings because it saves both objects' measurement data (general, Run, Beam) to the same file. Run and Beam and shared between the default Measurement and Simulation, so it doesn't affect actual use much, but the general data is not shared. As a result, the description part of Measurement tab in settings is not saved to a file.

Another, more serious issue is that changing the name in Measurement tab leads to .measurement file duplication for default settings: Measurement saves with the new name and Simulation and saves with the old name. This is migitated with 9b7e3af.

Reproduction

  1. Create a new request.
  2. Change the value of Request settings > Measurement > Description (or name if enabled)
  3. Observe that Measurement saves with the correct description, followed by Simulation overwriting the changes.
@tpitkanen tpitkanen added the bug Something isn't working label Nov 25, 2020
@tpitkanen
Copy link
Member Author

tpitkanen commented Nov 25, 2020

This isn't a big issue anymore thanks to the migitation, but it should probably be fixed at some point.

I see five possible ways to solve this:

  1. Create a new class for the general part and share it between the default Measurement and Simulation. This is probably the "neatest" option.
  2. Separate Run (and its Beam) to its own file and use only it in Simulation. Do a similar thing for Measurement. This doesn't really solve the issue though because non-default Simulations still need to save their descriptions.
  3. Add an option to Simulation.to_file for skipping .measurement part and use it for the default settings.
  4. Save Simulation before Measurement in request settings. This is more of a workaround, but it's easy to do.
  5. Have Simulation save its information with a different file extension. This leads to (probably unneeded) backwards incompatibility issue.

@tpitkanen
Copy link
Member Author

More information in commit c1921d4

tpitkanen added a commit that referenced this issue Nov 26, 2020
- Renaming ElementSimulations is important, and they don't seem to be affected by #100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant