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

🚀 1.2 #581

Closed
22 of 36 tasks
ivan-aksamentov opened this issue Apr 17, 2020 · 13 comments
Closed
22 of 36 tasks

🚀 1.2 #581

ivan-aksamentov opened this issue Apr 17, 2020 · 13 comments
Labels
IMPORTANT Take this immediately!
Milestone

Comments

@ivan-aksamentov
Copy link
Member

ivan-aksamentov commented Apr 17, 2020

This is a superissue to aggregate and prioritize issues and PRs currently in the works

https://github.com/neherlab/covid19_scenarios/milestone/3

🍎 Core features

- Uncertainty of parameters

Some parameters are now ranges {min, max}. Results are now a distribution [{mean, lower, upper}]

- Mitigation presets

Mitigation table should be populated with real data

- Parameter upload

Currently scenarios can be shared via URL. It is not perfect and we constantly have problems with it. File sharing would be another option.

- Double-check URL validation and add error dialogs

Currently errors in URL import are are silent for the user

🍌 Important

- Automatic data updates

- Algorithm in a webworker

- Fix remaining type issues and enable build-time type checking

- Translations

  • Gitlocalize is now in place. But it is unclear what has to be done next.
  • English strings need to be updated for the uncertainty feature
  • find translators?

🥝 Maybe

- Additional details in PDF

  • Additional details for PDF print #488
  • add MDX component when large paragraphs are needed, to simplify editing
  • pass props to MDX and render dynamic paragraphs (with variables inserted etc.)
  • add more content

- Improve error pages

@ivan-aksamentov ivan-aksamentov added t:feat Type: request of a new feature, functionality, enchancement help wanted Extra attention is needed needs triage Review this and assign labels labels Apr 17, 2020
@ivan-aksamentov ivan-aksamentov added this to the 1.2 milestone Apr 17, 2020
@ivan-aksamentov ivan-aksamentov added IMPORTANT Take this immediately! and removed help wanted Extra attention is needed needs triage Review this and assign labels t:feat Type: request of a new feature, functionality, enchancement labels Apr 17, 2020
@nnoll nnoll mentioned this issue Apr 17, 2020
3 tasks
@noleti
Copy link
Collaborator

noleti commented Apr 17, 2020

regarding the sharing of scenarios via URL: could you maintain a simple cache/hash table (probably separate from the app server) to essentially have random keys and parameters as values? Then URL references could be like https://covid19-scenarios.org/Aeif13D, the app would use the Aeif13D key to pull the parameter JSON string from the hash table, and we would have nice shareable short links? entries could be evicted after a while (or if possible, after they haven't been queried for x days). I only used redis a while back, and one would have to do the math to see how much data would be stored in the DB/day etc. Uploading files could be left as addition for people that want to use the app more as an API.

@nnoll
Copy link
Collaborator

nnoll commented Apr 17, 2020

@noleti this is what I imagine as well.

@noleti
Copy link
Collaborator

noleti commented Apr 17, 2020

another maybe: localization? We would a) need enough translations (and verify they currently catch everything needed), b) see that it works in the current UI

@ivan-aksamentov
Copy link
Member Author

ivan-aksamentov commented Apr 17, 2020

@noleti

Regarding the URL suggestion, we thought about it previously. This is basically a URL shortener service (like goo.gl, t.co and bit.ly), except we need to fetch value from there in the response body, bypassing the URI. However it only workarounds the problem. Plus the need of maintaining the online service and the fact that it's a new global variable (need some sort of separate environments for prod, staging and development, to not mess up the live server). We thought file-based solution is somewhat more "final". But we can discuss that. Ideally, of course, we have a backend of our own and store the data in a normal database, without hacks.

Regarding translations, I don't know what has to be done. In order to translate, we need English version to be finalized. But it's never final because we change everything every day. So I guess the translations have to be done in an incremental fashion. But that's kinda annoying for the translators.

@noleti
Copy link
Collaborator

noleti commented Apr 18, 2020

In my view, there are two distinct target audiences: "consumers" and "pros". The former will just look at a graph for their country, and not play with values too much (at most starting infected, ICU beds, and R0/ mitigations). The latter might want to try many different scenarios, seasonal influence, severity assumptions, age distributions, etc. For the former, scenario sharing should be as easy as possible, i.e. the hash in the URL, lookup from DB by your API. The latter user group will be more comfortable with downloading files, changing or generating files on their side, and re-simulating based on the files. That audience would also need more API capabilities (e.g., just return results, plot.png, pdf based on uploaded file). Once they have settings they want to share, they could just use the URL shortener again.

I don't really see the issue with sharing the same DB for stable and testing instances, as long as the DB is key/value store (e.g. Redis). If keys are all pseudo-random, the instances should(TM) not interact? The values should have a metadatum about the version of the schema, maybe. If you start to use a nosql DB with schemas etc (e.g., MongoDB), things will get more complicated I guess (i.e. new versions require new schemas). Or do you mean SQL with "normal database"? There would be the same schema issues I guess?

Storage-wise: I'm not sure how many users you have daily, but lets assume 1M. If each scenario settings needs 3kB (current settings export), then this would be 3GB. But the current settings have some crazy float precision (and pretty printing), so maybe 1kB/setting is more realistic. Given that many users will concentrate on few countries and default settings, I assume using a hash of the settings as key will lead to further storage reduction. So the database would maybe need 10GB if values are kept for a week (more to be on the safe side). cache.r4.large aws instances with 12 GB RAM cost about 150 USD/month? So key:value caching with minimal REST API boilerplate on your server seems feasible to me. Not that I am volunteering to write the code though.

Regarding translation: I think we will have to live with the risk of having some untranslated strings. The Gitlocalize should make it easy for people to contribute, though. We just need to write some instructions/advertise this (If we want to use localization soon). I think we should also start to use "placeholder/ID" strings in the app code, and have the actual text in the EN translation files. but I didn't dig into this yet.

@ivan-aksamentov
Copy link
Member Author

@noleti By "normal database" I mean whatever stores data in a typed format, not just a string of serialized JSON (which our URLs are). For shortener, hosting or storage cost should not be a problem.

Why do we need to use placeholders in the app? Won't English text do for placeholders? It seems to be working alright so far.

@ivan-aksamentov ivan-aksamentov pinned this issue Apr 18, 2020
@noleti
Copy link
Collaborator

noleti commented Apr 18, 2020

Re: placeholders. The way I understand the localization setup from #494 is as follows: we extract strings from the .ts/.tsx files, and generate these dicts from the strings. the dicts currently are setting the value to key by default. This means that if we change the original string a bit, a new key will be generated and needed to be translated in all languages. If instead we use placeholders, we can decide if the english string only changed a bit (and keep the placeholder and all existing translations), or if the meaning is so different a new translation needs to be done (by introducing a new placeholder). Does that make sense? I am not used to i18n, so I might misunderstand things.

@davihans
Copy link
Contributor

@ivan-aksamentov Is this what you had in mind for the tooltip layout?

tooltip_tuple

@whiver
Copy link
Contributor

whiver commented Apr 21, 2020

@noleti @ivan-aksamentov I agree for the localization, this would be great to re-enable the language dropdown. Because there is no point in updating the translations if we don't use them.

For the debate between using real strings as keys / using IDs to reference translated strings in the code: I see your point about – modifying translated text in the code also changes the key used for other languages. The problem with using keys is that if you decide to update a text in English, the other languages will still have the old translated version, which could not be relevant anymore if the text changed a lot. Worse: in gitlocalize, you won't easily see that a translation isn't up to date. On the contrary, by using directly the string as key, it also removes the translation, avoiding the risk of having translation mismatchs.

That said, I understand that it's not perfect: if you remove a space in the code, every corresponding translation will be reset. But I still think this is the best tradeoff for now. Maybe another translation platform than Gitlocalize could spot outdated translations, but that's not the case right now :/

@ivan-aksamentov
Copy link
Member Author

@davihans I am not sure. We need to ask @nnoll. Also this may influence the format: #613

@nnoll
Copy link
Collaborator

nnoll commented Apr 22, 2020 via email

@ivan-aksamentov
Copy link
Member Author

Uncertainty is released in 1.2
Import will be released in 1.3 shortly: https://github.com/neherlab/covid19_scenarios/milestone/4
The remaining is moved further on the timeline.

@ivan-aksamentov ivan-aksamentov unpinned this issue May 1, 2020
@psaux01
Copy link

psaux01 commented May 23, 2020

Este es un super tema para agregar y priorizar problemas y relaciones públicas actualmente en proceso

https://github.com/neherlab/covid19_scenarios/milestone/3

Características principales

- Incertidumbre de los parámetros.

Algunos parámetros son ahora rangos {min, max}. Los resultados ahora son una distribución[{mean, lower, upper}]

  • algoritmo # 537

  • UI / UX: # 580

    • Número de carreras ajustables (con spinbox) # 599
    • ejecutar indicador de progresoParece que esto no se puede hacer para el cálculo en el mismo hilo. ¿Quizás con trabajadores web o algo así como la saga redux?
    • mejores controles deslizantes y / o spinboxes para R0 y Mitigación # 604
    • validar la nueva gama spinboxes
  • carreras largas y cortas: # 582 __

    • spinbox para el número de carreras # 599
    • spinbox limit min a 10
    • correr en un trabajador web # 505
  • mejores parcelas

    • información sobre herramientas: números de diseño como una tupla
    • mejor tabla de vista previa de impresión

- Presets de mitigación

La tabla de mitigación debe rellenarse con datos reales.

- Parameter upload

Currently scenarios can be shared via URL. It is not perfect and we constantly have problems with it. File sharing would be another option.

- Double-check URL validation and add error dialogs

Currently errors in URL import are are silent for the user

Important

- Automatic data updates

- Algorithm in a webworker

- Fix remaining type issues and enable build-time type checking

- Translations

  • Gitlocalize is now in place. But it is unclear what has to be done next.
  • English strings need to be updated for the uncertainty feature
  • find translators?

Maybe

- Additional details in PDF

  • Additional details for PDF print #488
  • add MDX component when large paragraphs are needed, to simplify editing
  • pass props to MDX and render dynamic paragraphs (with variables inserted etc.)
  • add more content

- Improve error pages

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

No branches or pull requests

6 participants