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

Fix load_study #182

Merged
merged 7 commits into from
Oct 18, 2023
Merged

Fix load_study #182

merged 7 commits into from
Oct 18, 2023

Conversation

pedroripper
Copy link
Member

@pedroripper pedroripper commented Sep 20, 2023

Currently, when reading the psrclasses.json file from a previous study, PSRI does not check if the attributes inside the elements follow the PMD.

Also, PSRI is adding the data to the study exactly as it was in the JSON file. So when parsing an attribute that should be a Dates.Date in psrclasses.json, it reads as a string. Example:

{
  "Teta": [
      0.0
  ],
  "code": 0,
  "AVId": "string",
  "name": "string",
  "reference_id": 4,
  "Ordem": [
      0
  ],
  "Vazao": [
      0.0
  ],
  "Data": [
      "1900-01-01" <-------------
  ]
},

The new version for the load_study function has 1 new parameter:

  • rectify_json_data flag. false by default

This PR fixes all these issues. It should be merged after PR #180

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (df00f37) 79.97% compared to head (e113f9c) 79.97%.
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #182   +/-   ##
=======================================
  Coverage   79.97%   79.97%           
=======================================
  Files          21       21           
  Lines        2847     2872   +25     
=======================================
+ Hits         2277     2297   +20     
- Misses        570      575    +5     
Files Coverage Δ
src/OpenStudy/study_openinterface.jl 77.75% <100.00%> (+0.11%) ⬆️
src/modification_api.jl 78.17% <100.00%> (+0.45%) ⬆️
src/OpenStudy/relations.jl 80.75% <57.14%> (-0.71%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guilhermebodin guilhermebodin merged commit fe79487 into master Oct 18, 2023
8 of 9 checks passed
@pedroripper pedroripper deleted the pr/read-defaults branch December 7, 2023 15:18
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.

2 participants