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

SAM time slider: allow selection of "Year" variable in addition to "Observation date" (and maybe also temporal ordinals...) #761

Open
danicahelb opened this issue Nov 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@danicahelb
Copy link
Contributor

I am looking at PRISM resistance on qa.restricted.clinepi

I want to use "Year" in the time slider but I cannot select this variable. What needs to happen to enable other variables to be used here? can we utilize the "is_temporal" annotation property to determine which variables can be used in the slider?

image
@danicahelb danicahelb added the bug Something isn't working label Nov 29, 2023
@danicahelb
Copy link
Contributor Author

Slack discussions with @bobular

Bob MacCallum
Hi Danica, it currently needs to be a proper date variable, sorry. We decided that there was undesirable implementation and maintenance overhead associated with handling both date and number variables in the timeslider, but it could be done.

Danica Helb
Seems like it would be relatively easy to always include “Year” terms? this could be done across studies using the IRI, then we wouldn’t need to maintain annotation properties for individual studies (edited)

Bob MacCallum
It's not good to hardcode IRIs in the front end. The implementation issues are more to do with handling numbers (which are numbers) and dates (which are stored as dates in Oracle and handled as strings in the front/back ends) at the same time. It can be done, but there is a cost.
Though, as I guess you're hinting at, the cost might be slightly lower if we were sure the numbers were only four digit year numbers.
One problem is that Oracle can't store partially specified dates (e.g. "2001") in date variables. It expects YYYY-MM-DD. So we can't just re-annotate that variable as a proper date variable without appending "-01-01" (Jan 1st) which is not desirable either.
Apart from a few typos, the Observation Date variable in PRISM Resistance Surveillance looks perfectly usable instead of Year.

Danica Helb
The issue is that only 28% of samples have an observation date recorded, but 100% of samples have a year recorded! So this essentially makes the time slider unusable….
image

Bob MacCallum
Ah, well there is that I guess.

Danica Helb
its fine for now… but important to address in the future. thanks for the explanation
New

Bob MacCallum
I'd personally prefer that only dates are allowed in the time slider. Not numbers like 1, 2, 3 (for year 1, year 2, etc). There are wider questions about storing partial dates/date ranges ("2001" is really a date range "2001-01-01 to 2001-12-31") - which I've had only in DM discussions with @dmgaldi to date so far. Would be good to put some thoughts in a github ticket!

@danicahelb danicahelb changed the title SAM time slider: cannot use "Year" variable in PRISM Resistance SAM time slider: allow selection of "Year" variable in addition to "Observation date" Nov 29, 2023
@dmfalke
Copy link
Member

dmfalke commented Nov 29, 2023

Fwiw, i think we should consider having an annotation declaring that the variable is a “year” variable, and then we can add that to the constraints for the time slider

@dmfalke dmfalke transferred this issue from VEuPathDB/EdaNewIssues Jan 9, 2024
@bobular bobular changed the title SAM time slider: allow selection of "Year" variable in addition to "Observation date" SAM time slider: allow selection of "Year" variable in addition to "Observation date" (and maybe also temporal ordinals...) Apr 30, 2024
@bobular
Copy link
Member

bobular commented Apr 30, 2024

There's a new use case for the T0 prototype where a YYYY-MM string is forced to be ordinal (forceStringType=yes is the magic incarnation). It's already available for time series and the new timeline histogram. It should probably be available in the timeslider too.

Here are some considerations before implementing any of this

  • number and date types will lend themselves more readily to the forward/back stepping functionality planned. However, it would still be possible to quantise the timeslider selection for ordinals and allow forward backward stepping. The code might get ugly though.
  • the code will generally be ugly - I will do a costing now...

@dmfalke
Copy link
Member

dmfalke commented Apr 30, 2024

If possible, I would love for EDA to support date variables whose values are any ISO compatible format, so YYYY, YYYY-MM, or YYYY-MM-DD. Maybe @dmgaldi or @ryanrdoherty can comment on this?

@bobular
Copy link
Member

bobular commented May 9, 2024

Here's the variable metadata for the Year variable in question. It's integer continuous.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants