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

sf and sftime changes instead of sdst functions #6

Closed
kyle-messier opened this issue Feb 5, 2024 · 8 comments
Closed

sf and sftime changes instead of sdst functions #6

kyle-messier opened this issue Feb 5, 2024 · 8 comments
Assignees

Comments

@kyle-messier
Copy link
Collaborator

No description provided.

@kyle-messier kyle-messier transferred this issue from NIEHS/beethoven Feb 12, 2024
@eva0marques
Copy link
Collaborator

eva0marques commented Feb 13, 2024

To do list

  • sf and sftime added to NAMESPACE

In R/manipulate_spacetime_data.R (and tests/testthat/test-manipulate_spacetime_data.R):

  • adapt is_stdt() to a new fonction check_mysftime() to see if mysftime has the right format (also a version for check_mysf()?)
  • test for check_mysftime() and check_mysf()
  • adapt convert_stobj_to_stdt() to as_mysftime() macro (function and UT), calling to following functions (already available and tested: dt_as_sf() and dt_as_sftime()):
    • dt_as_mysftime() (function and UT)
    • sf_as_mysftime() (function and UT)
    • sftime_as_mysftime() (function and UT)
    • spatraster_as_sftime() (function and UT)
    • spatvector_as_sftime() (function and UT)
    • spatrds_as_sftime() (function and UT)
  • same but for as_mysf() from data.frame, data.table, sf, SpatRaster, SpatVector
  • turn convert_stdt() into:
    • sftime_as_sf() (function and UT)
    • sftime_as_spatvector() (function and UT)
    • sftime_as_spatraster() (function and UT)
    • sftime_as_spatrds() (function and UT)
  • remove redundancy in test for as_mysftime() (reuse all the other functions)

Future work: see how stars format conversion to sf/sftime works

@eva0marques
Copy link
Collaborator

In case anything goes wrong with this issue, I duplicated main branch before changes in a new branch "save_branch_stdt.

eva0marques added a commit that referenced this issue Feb 16, 2024
…emove_stdt

#6 add dt_as_mysftime() and as_mysftime() functions
@eva0marques
Copy link
Collaborator

Notes:

  • terra::vect() function works to convert sf class to SpatVector (but not for sftime class: see new function).

@eva0marques
Copy link
Collaborator

@mitchellmanware @sigmafelix
I have added to my todo to remove all calls to stdt functions in calc_covariates.R but I cannot find any of them anymore (which is very cool!!) But I just wanna check with you I am not hallucinating (it can happen sometimes 🫨🫣): did I miss something, you've already removed them?

@sigmafelix
Copy link
Collaborator

@eva0marques At least in amadeus functions I've been working on, I replaced lines with stdt calls with generic functions (e.g., sf or terra functions). stdt compatibility is necessary at this moment as cross-validation indexing functions in beethoven rely on stdt.

@eva0marques
Copy link
Collaborator

Ok, thanks! So to let you know, I implemented all the conversion functions you can see in my comment above.

@eva0marques eva0marques reopened this Feb 26, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in beethoven Feb 26, 2024
@eva0marques
Copy link
Collaborator

I close this issue on amadeus and open one in beethoven.
As @sigmafelix said, we need to modify cross-validation functions in beethoven to remove the calls to stdt format. It implies to load Amadeus in Beethoven or to copy manipulate_space_time_data.R.

@eva0marques eva0marques moved this from ✅ Done to 👀 In review in beethoven Feb 26, 2024
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

No branches or pull requests

3 participants