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

Support a 'database refresh' from the context file #74

Closed
JamesWrigley opened this issue Jul 21, 2023 · 2 comments
Closed

Support a 'database refresh' from the context file #74

JamesWrigley opened this issue Jul 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@JamesWrigley
Copy link
Member

Right now the GUI treats the context file as a source-of-truth for things like:

  • What variables exist
  • What their titles (and other attributes) are

This has some unfortunate behaviour, such as:

  • Variables that are in the database but not in the context file will only be displayed with their variable name as title (all other information is lost)
  • If the context file is invalid for some reason then the GUI will crash when it tries to open it
  • If a variable title is changed, the new title will only be displayed after the database is reopened

In general I think the solution is to store all variable information in the database, so that the database becomes the source-of-truth for the GUI. But then the question is, how do we get new information from the context file into the database? Right now we would have to do something like reprocess a run so that the new variable settings get saved, but that feels quite hacky.

Another option is to allow the user to click a button to refresh the metadata in the database from the context file, such that the context file would be loaded into a ContextFile object with all the metadata and then saved.

@JamesWrigley JamesWrigley added the bug Something isn't working label Jul 21, 2023
@takluyver
Copy link
Member

This is kind of done in #203. Variables recorded in the database are refreshed:

  • Shortly after launching the GUI
  • Before a run is processed (inc. new runs & reprocessing)
  • On the command amore-proto read-context

We could also extend that, e.g. refresh any time you save the context file from the GUI.

@JamesWrigley up to you whether you think we should close this or leave it open for further improvements.

@JamesWrigley
Copy link
Member Author

I think we can close this one 🎉

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

2 participants