-
Notifications
You must be signed in to change notification settings - Fork 1
Persist analyses #191
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
Persist analyses #191
Conversation
It is before setExperiments to have now plots being added by runExperiment
…lysis types to src/lib/analysis_type.ts Moved types so type and its derived JSON schema are in same file.
There was a problem hiding this 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 implements persistence for analyses by storing them in local storage and in the state file. The main changes involve extracting analysis type definitions into a dedicated module, adding validation/parsing for analyses, and updating the state encoding/decoding logic to handle analyses.
- Refactors analysis types into a separate
analysis_type.tsmodule with validation - Adds analysis encoding/decoding in the state management
- Fixes a template literal bug and adds support for additional profile variables (rh, T, p)
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/class-solid/src/routes/index.tsx | Updates imports to use analysisNames from the new analysis_type module |
| apps/class-solid/src/lib/store.ts | Removes analysis type definitions (moved to analysis_type.ts) and adds setAnalyses call in loadStateFromString |
| apps/class-solid/src/lib/profiles.ts | Fixes template literal syntax bug and adds support for rh, T, and p variables in observation profiles |
| apps/class-solid/src/lib/encode.ts | Adds analysis parsing/encoding to state serialization functions |
| apps/class-solid/src/lib/analysis_type.ts | New file defining analysis types with JSON Schema validation for parsing persisted analyses |
| apps/class-solid/src/components/Analysis.tsx | Updates imports to use analysis types from analysis_type module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Persistence of analysis works, but one thing that strikes me is that all close model runs are deselected in the legend when first rendered. I need to turn all of them on manually. Might related to #178. |
|
Does this only work with URL or also in a JSON config? And could we combine that? class-model.github.io/class-web?s=aabcde&analysis=.... |
When you make a share link with state in the URL ( |
Indeed looks like the checkbox states are stored in the analyse object, but just locally in the component. |
Persist analyses in local storage and in state file via share dialog when state is too big.
For example http://localhost:3000#%7B%22exper.... should load 5 analysis with 3 vertical profiles with temperature, relative humidity and potential temp vars selected.
Fixes #189