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

Ensure generate_author_yml retains affiliation order by person #570

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

conig
Copy link
Contributor

@conig conig commented Oct 3, 2023

As described in Issue #569, generate_author_yml is sorting affiliation order within person.
This PR introduces a test to catch this scenario, and makes a minimal change to ensure that affiliation order by person is maintained.

Note the affiliation for Person 2 is now "2,1"

library(papaja)

generate_author_yml (
  researchers = list(
    "Person 1" = c("uni1", "uni2"),
    "Person 2" = c("uni2", "uni1")
  ),
  affiliations = list(
    "uni1" = "The First Uni",
    "uni2" = "The Second Uni"
  ),
  corres_name = "Person 1",
  corres_address = "123 Example Street, Street, state 2121",
  corres_email = "person1@example.com"
)
#> author:
#>   - name          : "Person 1"
#>     affiliation   : "1,2"
#>     corresponding : yes
#>     address       : "123 Example Street, Street, state 2121"
#>     email         : "person1@example.com"
#>   - name          : "Person 2"
#>     affiliation   : "2,1"
#> 
#> 
#> affiliation:
#>   - id            : "1"
#>     institution   : "The First Uni"
#>   - id            : "2"
#>     institution   : "The Second Uni"

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (27715f1) 82.04% compared to head (850fa10) 82.04%.

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #570   +/-   ##
=======================================
  Coverage   82.04%   82.04%           
=======================================
  Files          45       45           
  Lines        4221     4222    +1     
=======================================
+ Hits         3463     3464    +1     
  Misses        758      758           
Files Coverage Δ
R/generate_author_yml.R 93.47% <100.00%> (+0.14%) ⬆️

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

Copy link
Owner

@crsh crsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me. Could you also add a brief entry to the NEWS file?

@conig
Copy link
Contributor Author

conig commented Oct 5, 2023

thanks @crsh, done

@crsh crsh merged commit f17599f into crsh:main Oct 6, 2023
5 checks passed
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.

4 participants