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

Added Author Coercion #46

Merged
merged 27 commits into from Mar 5, 2021
Merged

Added Author Coercion #46

merged 27 commits into from Mar 5, 2021

Conversation

muschellij2
Copy link
Contributor

Added a parser to coerce Author to Authors@R in reference to issue #44. Let me know if this is desirable or wanted in the package. Otherwise, I can use this function in my own work.

R/authors-at-r.R Outdated
}
if (has_author & has_authors_at_r) {
# Delete Author as it has Authors@R
obj$del("Author")
Copy link
Member

Choose a reason for hiding this comment

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

You cannot modify obj, it will change (the representation of) the DESCRIPTION file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand completely. Can you not remove that field? I can simply add the Authors@R field, but then the description will both have Author and Authors@R.

I don't understand if you cannot modify the result within the function or if you do not want to use del in the function. I removed any deletion in the recent pushes. Is it OK if you do self$set_authors or is that modification undesirable as well?

Copy link
Member

Choose a reason for hiding this comment

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

You cannot remove or add fields. This function is called from $get_authors(), which cannot modify the underlying data. It can return an answer based on Authors@R or Author, but cannot add or remove fields.

Copy link
Member

Choose a reason for hiding this comment

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

Just think about it. If you modify it, then desc::desc_get_authors() rewrites the DESCRIPTION file. And we definitely don't want that.

@gaborcsardi
Copy link
Member

I don't know TBH. I guess we can give it a try.

@gaborcsardi
Copy link
Member

But you need to fix this, so that it does not modify the object.

@muschellij2
Copy link
Contributor Author

muschellij2 commented Jul 14, 2017 via email

@codecov-io
Copy link

codecov-io commented Jul 14, 2017

Codecov Report

Merging #46 (7be86f2) into master (bd88d30) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   98.85%   98.87%   +0.02%     
==========================================
  Files          18       18              
  Lines        1047     1071      +24     
==========================================
+ Hits         1035     1059      +24     
  Misses         12       12              
Impacted Files Coverage Δ
R/authors-at-r.R 98.93% <100.00%> (+0.14%) ⬆️
R/description.R 97.63% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd88d30...7be86f2. Read the comment docs.

@gaborcsardi
Copy link
Member

I thought the goal was to "fix" get_authors().

So what would this function do then? Convert Author & Maintainer to Authors@R?

@muschellij2
Copy link
Contributor Author

muschellij2 commented Jul 14, 2017 via email

@gaborcsardi
Copy link
Member

gaborcsardi commented Jul 14, 2017 via email

@muschellij2
Copy link
Contributor Author

This should have the coverage needed with the test.

@muschellij2
Copy link
Contributor Author

Sorry - it NOW has passed all checks for coverage and travis/appveyor.

@muschellij2
Copy link
Contributor Author

I think this should be ready for merging @gaborcsardi if you want - checks passed and coercion method implemented.

…ed as per the PR.

Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	DESCRIPTION
#	tests/testthat/D6
@muschellij2
Copy link
Contributor Author

Hey @gaborcsardi - any thoughts on integrating this? I just re-integrated and resolved the conflicts for the authors coercion.

Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

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

Sorry for the long wait. Can you add docs, and a NEWS entry, and also the non-OO version?

Thanks!

DESCRIPTION Outdated Show resolved Hide resolved
R/authors-at-r.R Outdated Show resolved Hide resolved
R/authors-at-r.R Show resolved Hide resolved
@gaborcsardi
Copy link
Member

TBH I am also not crazy about the name of the method, I'll think about that.

Copy link
Contributor Author

@muschellij2 muschellij2 left a comment

Choose a reason for hiding this comment

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

This should fully implement the coerce_authors_at_r and document the API.

@muschellij2
Copy link
Contributor Author

Do you want to change the name?

Merge remote-tracking branch 'upstream/master'
@muschellij2
Copy link
Contributor Author

I have merge with upstream, I believe all changes have been addressed.

@muschellij2
Copy link
Contributor Author

I believe all issues are resolved @gaborcsardi

@muschellij2 muschellij2 closed this Sep 6, 2018
@muschellij2 muschellij2 reopened this Sep 6, 2018
@jayhesselberth
Copy link

It would be great to get this updated / merged.

Having old style Authors fields in DESCRIPTION is a common issue for building pkgdown sites.

@muschellij2
Copy link
Contributor Author

I think this is ready to go - can you re-review?

@gaborcsardi
Copy link
Member

Thanks and I am sorry for the long wait!

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

4 participants