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

Read csv as stanfit v2 (alternative version) #1619

Merged

Conversation

venpopov
Copy link
Contributor

An alternative version of #1618, as I noted in my comment here

Rather than having a new function, here I slightly modify the existing read_csv_as_stanfit() function and export it instead. I find this option a bit cleaner, slightly faster and likely easier to maintain.

The main things to note

  colnames(samples) <- gsub("\\[", ".", colnames(samples))
  colnames(samples) <- gsub("\\]", "", colnames(samples))
  colnames(samples) <- gsub("\\,", ".", colnames(samples))

as they introduce the issue that then needs to be solved by repair_stanfit()

Feel free to go with either #1618 or this.

- combines read_csv_as_stanfit  and read_csv_as_brms_stanfit into one function
- eliminates reading metadata from file
- remove redundant renaming
- remove renaming samples columns that otherwise needs to be fixed (paul-buerkner#1218)
@venpopov venpopov changed the title Read csv as stanfit v2 Read csv as stanfit v2 (alternative version) Mar 12, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 82.10%. Comparing base (15c0754) to head (0919664).
Report is 1 commits behind head on master.

❗ Current head 0919664 differs from pull request most recent head b8fd782. Consider uploading reports for the commit b8fd782 to get more accurate results

Files Patch % Lines
R/backends.R 0.00% 19 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1619   +/-   ##
=======================================
  Coverage   82.09%   82.10%           
=======================================
  Files          70       70           
  Lines       19849    19847    -2     
=======================================
  Hits        16295    16295           
+ Misses       3554     3552    -2     

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

@paul-buerkner paul-buerkner added this to the 2.21.0 milestone Mar 12, 2024
@paul-buerkner
Copy link
Owner

Looks good, thank you! I made some minor edits and will now merge the PR.

@paul-buerkner paul-buerkner merged commit a31ad2a into paul-buerkner:master Mar 12, 2024
4 of 5 checks passed
@venpopov
Copy link
Contributor Author

Cool, thank you, this will be super useful for me! And thanks for adding me as a contributor.

@venpopov venpopov deleted the read_csv_as_brms_stanfit_v2 branch March 12, 2024 12:02
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.

None yet

3 participants