Closed tiagoandresvaz closed 4 years ago
This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/neherlab/covid19-scenarios/6juh4enxl ✅ Preview: https://covid19-scenarios-git-fork-tiagoandresvaz-palliativeflux.neherlab.vercel.app
Hi @tiagoandresvaz,
this now looks very good to me. I think this addition is needed. Before we can merge this, we need to address a few things
palliative=0
reproduces the old behavior, so that would be an option. Currently the app with old jsons, but all values of the computation past infectious are undefined
since undefined values of palliative
enter. updates
pageI am also wondering whether we should rename critical
to ICU
in the table. Now that we also have palliative
, there are critically ill people that don't end up in ICU. But I am not sure what the least confusing terminology is... (@ivan-aksamentov ?? )
richard
whether we should rename critical to ICU in the table
Does it relate to ICU on other places? ICU beds, ICU on the plot? Should rename in all places then? And also, in export/import files etc.
@tiagoandresvaz @rneher
how do we handle old jsons
Ideally, the workflow is as follows:
[x] increment schema version (to 2.1.0): https://github.com/neherlab/covid19_scenarios/blob/f62c8dc9bc3b9dc6213b67c4379ab1d218d6b6ad/schemas/_SchemaVer.yml
schemaVer
of the incoming object) happens here. When a JSON or URL blob containing schemaVer
property arrives there, it will be directed to an appropriate code path.[x] generate and commit to git the generated typings and validators from the old schema version (2.0.0).
Go to master branch (before schema modification), generate typings and validator files (yarn schema:totypes
), save directory src/.generated/latest
to temporary place, go to branch of this PR, move the saved directory as src/.generated/2.0.0
, commit it. This way we can have src/.generated/latest
containing validators for 2.1.0
and src/.generated/2.0.0
for 2.0.0
.
[x] use these typings and validators to modify the deserialization code for the old version (2.0.0): mostly adjust imports and add palliative
with 0
on output. Note that we don't have to add 2.0.0
path to the serializer, because we always save data using the latest schema version.
This should automatically ensure that the application code always receives the object of version 2.1.0, however users with old JSONs and URLs will still able to load their data.
fix a few little things here and there (linting etc)
These are mostly formatting warning, can be fixed with yarn format:fix
.
Also, yarn lint
to run the entire static analysis stack. For more fine-grained control, check these npm scripts:
https://github.com/neherlab/covid19_scenarios/blob/f62c8dc9bc3b9dc6213b67c4379ab1d218d6b6ad/package.json#L25-L45
@ivan-aksamentov the app is running nicely after modifications that you and @rneher recommended.
But when loading jsons created with schema 2.0.0 version, it is rising: expected schemaVer
to be one of [2.1.0]
, but received: 2.0.0
it seems that only one version is allowed to be received. Can you confirm where is this configuration?
@tiagoandresvaz I added a few changes and commented on them above. This should fix the remaining problems.
Note that I also removed the src/.generated/latest
from version control, as the latest types are a subject to change and should always be generated on the fly to avoid mistakes. By contrast, the old types (v2.0.0) will never change anymore, so they can be committed.
Please pull and check that this stuff works on your side.
Code Climate has analyzed commit 071ebf09 and detected 0 issues on this pull request.
View more on Code Climate.
@ivan-aksamentov
Please pull and check that this stuff works on your side.
Pull done! It is ok on my side!
@tiagoandresvaz okay, let's merge this!
Related issues and PRs
703
753
Description
To implement the new proposed flux in the model and interfaces according to the discussion above.
Impacted Areas in the application
Age-Specific Parameters, and Model.
Testing
Edit age-specific parameters to see changes in deaths modeled in results.