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

Make data.json available in analysis scripts #238

Closed
WardBrian opened this issue Nov 1, 2024 · 5 comments · Fixed by #239
Closed

Make data.json available in analysis scripts #238

WardBrian opened this issue Nov 1, 2024 · 5 comments · Fixed by #239
Labels

Comments

@WardBrian
Copy link
Collaborator

It is often useful to analyze the results in the context of the data. The example we provide for the SIR model already does this by re-installing the package the data came from, but a more general solution would be to have the data.json available in the script. This style would also compose well with #179

We can do this with virtual file systems:

@jsoules
Copy link
Collaborator

jsoules commented Nov 1, 2024

Would moving to virtual file systems suggest that we should also revise the state model for those files in the reducer? Instead of keeping 2 copies in memory?

@WardBrian
Copy link
Collaborator Author

This would be something which is local to the runtime environment set-up for the scripts (e.g., inside the pyodide worker).

It arguably would be the wrong thing to do to unify this with the state model, since we explicitly would not want edits in the data to be visible in the analysis script if the sampler isn't re-run first

@magland
Copy link
Collaborator

magland commented Nov 1, 2024

Why not make it available as a data variable, as in the data generation scripts? Maybe I'm missing exactly what you are proposing.

@WardBrian
Copy link
Collaborator Author

We could try. I think that solution would require more work, for ultimately not much gain.

  1. We'd have to decide how to parse it into an R/Python object. If the user wanted something else, they're going to have to write more code anyway. If it's a lot of data, parsing it when they don't need it would also be a bummer
  2. The next feature I'm working on is Optional shim code when downloading a project with scripts #179, and the less 'magic' we have the better.
    The user loading it from ./data.json would mirror exactly what they'd do when running locally.

@magland
Copy link
Collaborator

magland commented Nov 1, 2024

Okay makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants