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

Provide populationData source strings in app #597, Part1 #606

Closed
wants to merge 12 commits into from

Conversation

realdy
Copy link

@realdy realdy commented Apr 20, 2020

Related issues and PRs

Related to Issue #597
Changed scenarios.py to include srcHospitalBeds in generating json

Description

Review changes to ensure that initial changes for scenarios.py are sufficient and do not cause any severe issues before moving on to expressing the changes within the app

Impacted Areas in the application

scenarios.py
scenarios.json
scenarios.yml
type.py

Testing

Run "make all" and verify that there are no errors.
Inspect the generated scenarios.json to verify that srcHospitalBeds is included
Also inspect type.py to verify that "src_hospital_beds" is an include parameter

…anged scenarios.py to include srcHospitalBeds in generating json
@vercel
Copy link

vercel bot commented Apr 20, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/covid19-scenarios/covid19-scenarios/qwy1uvgkt
✅ Preview: https://covid19-scenarios-git-fork-realdy-master.covid19-scenarios.now.sh

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 53119 lines exceeds the maximum allowed for the inline comments feature.

srcHospitalBeds:
type: string
minLength: 1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are currently not setting srcHospitalBeds as required in the schema. This means the app will have to tolerate missing keys. I'm not sure if we should set it as required or not, we will need to see later.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wasn't sure if it was necessary to make it required or not given its tenuous inclusion at the moment, but it's only a 1 line change in code, so we can always account for it later. From my understanding (albeit rudimentary), not making it required wouldn't flag some sort of error in case the parameter isn't included. Given that we aren't deadset on this feature, I figured having that sort of flexibility wouldn't be too detrimental.

And understood. I certainly figured that the tsv's would be rather excessive if included.
To verify, is there some way I can edit my pull request to ensure those aren't included, or should I just be mindful in future commits to not include those files?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a local checkout of this branch, so I think you should be safe to delete your last commit via resetting the head and force-pushing the branch. Or you just revert the commit (which keeps it in the history, with another undo-commit). In both cases, you can then make another commit on the branch which changes only the needed files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the latest commit was properly reverted and should have only the necessary changes, but let me know if I didn't do it correctly.

@noleti
Copy link
Collaborator

noleti commented Apr 20, 2020

Hi @realdy, please don't check in changed in data/case-counts and src/assets/data/case_counts.json, as these are unrelated to the code changes, and make the PR very hard to review. In particular, the inclusion of newer data leads to many changes in the scenarios.json.

From what I can tell, the other changes look good so far. As I noted, we will have to decide whether the src strings should be required by the schema, or be optional.

@noleti noleti added the pr: work in progress This is work in progress, do not merge until finished label Apr 20, 2020
…to explain functionality of files/help me remember which ones are likely relevant for the UI
…to explain functionality of files/help me remember which ones are likely relevant for the UI
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 53626 lines exceeds the maximum allowed for the inline comments feature.

…aram. Changed scenarios.py to include srcHospitalBeds in generating json"

This reverts commit d512353.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33350 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33385 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33412 lines exceeds the maximum allowed for the inline comments feature.

Unnecessary Inclusion
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 12084 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33304 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33304 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33304 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33312 lines exceeds the maximum allowed for the inline comments feature.

function getSrcStrings(srcHospitalBeds?: string, srcICUBeds?: string, srcPopulation?: string) {
let ret = ['Source: ', 'Source: ', 'Source ']
if (srcPopulation === undefined || srcPopulation === 'None') {
ret[0] = 'Source cannot be provided'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the negative messages not all the same (provided vs found?) I would prefer something like 'No data source in our records.' or similar for all of them.

@@ -43,7 +89,7 @@ function ScenarioCardPopulation({ errors, touched }: ScenarioCardPopulationProps
<FormSpinBox
identifier="population.populationServed"
label={t('Population')}
help={t('Number of people served by health care system.')}
help={t('Number of people served by health care system.\n'.concat(srcStr[0]))}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '\n' does not seem to work, can you use a space instead?

help={t(
'Number of hospital beds available in health care system. Presets are rough estimates indicating total capacity. Number of beds available for COVID-19 treatment is likely much lower.',
'Number of hospital beds available in health care system. Number of beds available for COVID-19 treatment is likely much lower.'.concat(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a space to separate the previous and new string?

src/components/Main/Scenario/ScenarioCardPopulation.tsx Outdated Show resolved Hide resolved
@noleti
Copy link
Collaborator

noleti commented Apr 22, 2020

@realdy This looks nice to me, thanks. I made some small comments, but overall this works well for me.

@ivan-aksamentov I leave this to you to judge if this will complicate the app too much. I find this passing of source information through help text intuitive and less effort than a separate source page (which could still be made).

We could even have source strings for the age distribution, imports per day (estimated by model.py imho), case-counts, etc (I leave this for the future).

In general, links in the source strings are not clickable (and would be ideally). We can address that in the future, if this PR is generally accepted.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 33313 lines exceeds the maximum allowed for the inline comments feature.

@codeclimate
Copy link

codeclimate bot commented Apr 22, 2020

Code Climate has analyzed commit dfe182d and detected 0 issues on this pull request.

View more on Code Climate.

@realdy
Copy link
Author

realdy commented Apr 22, 2020

@noleti
Just made the changes you requested. Thanks for the helpful comments! Still haven't figured out how to deal with the new line character, but if this pr gets accepted I'll go forward with attempting to develop the other features you mentioned. At this point though, I think this is enough for a decent proof of concept and I'd rather not spend any more work on it if the PR ultimately is not accepted.

@noleti noleti removed the pr: work in progress This is work in progress, do not merge until finished label Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants