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

Minor issue returning version number with get_versions #65

Closed
fontikar opened this issue Dec 22, 2021 · 2 comments
Closed

Minor issue returning version number with get_versions #65

fontikar opened this issue Dec 22, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request user support
Milestone

Comments

@fontikar
Copy link

fontikar commented Dec 22, 2021

Hi maintainers!

This is a minor issue!

I wanted to return the version info for a particular doi

get_versions('10.5281/zenodo.3568417')
This is the table that is returned:

             created       date version                    doi
1 2019-12-09 23:13:04 2019-12-09       1 10.5281/zenodo.3568418
2 2019-12-10 00:15:52 2019-12-09       2 10.5281/zenodo.3568429
3 2019-12-19 03:48:40 2019-12-09       3 10.5281/zenodo.3583418
4 2020-12-11 08:38:30 2020-07-08       4 10.5281/zenodo.4316516
5 2020-12-11 08:43:46 2020-12-11       5 10.5281/zenodo.4316550
6 2021-07-14 01:14:53 2021-07-14       6 10.5281/zenodo.5099545
7 2021-07-14 01:25:41 2021-07-14       7 10.5281/zenodo.5099552
8 2021-07-18 06:32:30 2021-07-14       8 10.5281/zenodo.5112001

I noticed the version number does not match the version numbers on the website.

A colleague of mine ran the same line of code and got a different output with correct version numbers

get_versions('10.5281/zenodo.3568417')

        date version                    doi
1 2020-07-08  v2.0.0 10.5281/zenodo.4316516
2 2020-12-11  v2.1.0 10.5281/zenodo.4316550
3 2021-07-14  v3.0.0 10.5281/zenodo.5099545
4 2021-07-14  v3.0.1 10.5281/zenodo.5099552
5 2021-07-14  v3.0.2 10.5281/zenodo.5112001
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reprex_2.0.1 zen4R_0.5-2 

loaded via a namespace (and not attached):
 [1] compiler_4.1.2   pillar_1.6.4     highr_0.9        tools_4.1.2     
 [5] digest_0.6.29    jsonlite_1.7.2   evaluate_0.14    tibble_3.1.6    
 [9] lifecycle_1.0.1  pkgconfig_2.0.3  rlang_0.4.12     cli_3.1.0       
[13] rstudioapi_0.13  curl_4.3.2       yaml_2.2.1       xfun_0.28       
[17] fastmap_1.1.0    withr_2.4.3      httr_1.4.2       xml2_1.3.3      
[21] knitr_1.36       fs_1.5.1         vctrs_0.3.8      glue_1.5.1      
[25] R6_2.5.1         processx_3.5.2   fansi_0.5.0      rmarkdown_2.11  
[29] callr_3.7.0      clipr_0.7.1      magrittr_2.0.1   ps_1.6.0        
[33] htmltools_0.5.2  ellipsis_0.3.2   assertthat_0.2.1 keyring_1.3.0   
[37] utf8_1.2.2       crayon_1.4.2  ````

Any advice would be greatly appreciated!
@eblondel
Copy link
Owner

@fontikar The output you get is the one of the most recent version of zen4R. Your colleague is still running a previous version of zen4R, in which at that time the versions were fetched using from website html instead of API, and where it was limited to the latest versions of a record. Now I switched to the API to get all versions, but for the "version" of the record, it's an incremental number and not the version as specified by whom created the record; I'm going to have a look if we can inherit it and let you know here;

@eblondel eblondel self-assigned this Dec 23, 2021
@eblondel eblondel added the enhancement New feature or request label Dec 23, 2021
@eblondel eblondel added this to the 0.5 milestone Dec 23, 2021
eblondel added a commit that referenced this issue Dec 23, 2021
@eblondel
Copy link
Owner

@fontikar please try to re-install the package from Github.

Doing get_versions('10.5281/zenodo.3568417')

              created       date version                    doi
1 2019-12-09 23:13:04 2019-12-09  v0.1.0 10.5281/zenodo.3568418
2 2019-12-10 00:15:52 2019-12-09  v0.9.0 10.5281/zenodo.3568429
3 2019-12-19 03:48:40 2019-12-09  v0.9.1 10.5281/zenodo.3583418
4 2020-12-11 08:38:30 2020-07-08  v2.0.0 10.5281/zenodo.4316516
5 2020-12-11 08:43:46 2020-12-11  v2.1.0 10.5281/zenodo.4316550
6 2021-07-14 01:14:53 2021-07-14  v3.0.0 10.5281/zenodo.5099545
7 2021-07-14 01:25:41 2021-07-14  v3.0.1 10.5281/zenodo.5099552
8 2021-07-18 06:32:30 2021-07-14  v3.0.2 10.5281/zenodo.5112001

The date corresponds to the metadata date element, which is not necessarily always updated when a new version is created. For that i've added the created date which is the date when the record version was created. A incremental version number is set only when all record versions are unset (which is the same behaviour followed by the Zenodo website to display versions).

Let me know if it's ok now

Best wishes
Emmanuel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user support
Projects
None yet
Development

No branches or pull requests

2 participants