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

export xp_call_name() for downstream use #2096

Merged
merged 6 commits into from
Aug 29, 2023
Merged

export xp_call_name() for downstream use #2096

merged 6 commits into from
Aug 29, 2023

Conversation

MichaelChirico
Copy link
Collaborator

Closes #2023

@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2023

Codecov Report

Merging #2096 (8b1f6f3) into main (c21600a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

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

@@           Coverage Diff           @@
##             main    #2096   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         117      117           
  Lines        5158     5162    +4     
=======================================
+ Hits         5140     5144    +4     
  Misses         18       18           
Files Changed Coverage Δ
R/xp_utils.R 100.00% <100.00%> (ø)

@AshesITR
Copy link
Collaborator

Wondering about if the name is "nice" for exporting.

  • Is xp_ a common prefix for any package?
  • Is there a package for XPaths that has set a standard for XPath-related functions like xml2 did for xml_?

@MichaelChirico
Copy link
Collaborator Author

Is xp_ a common prefix for any package?

No. Here's the 3 packages (including {lintr}) on CRAN with any functions starting with xp_:

https://github.com/search?q=org%3Acran+language%3Ar+%2F%5Exp_%5Ba-zA-Z0-9._%5D%2B%5Cs*%28%3C-%7C%3D%29%5Cs*function%2F&type=code

  • {dndR} is for Dungeons & Dragons, XP = Experience Points
  • {xpose} I think uses it for "xplot" (not sure what that is)

For packages using _?xp_ anywhere in their NAMESPACE, see:

https://github.com/search?q=org%3Acran+path%3ANAMESPACE+%2F%5B%5Ea-zA-Z%5Dxp_%5Ba-zA-Z0-9._%5D%2B%2F&type=code

Is there a package for XPaths that has set a standard for XPath-related functions like xml2 did for xml_?

AFAIK, no. The only other CRAN package mentioning "XPath" in its title is {selectr}, which is for translating CSS queries to XPath (and not the other way around).

https://cran.r-project.org/web/packages/available_packages_by_name.html

There are many more packages that use "XPath" somewhere in their sources, I didn't see any pattern emerge when glancing through the results here:

https://github.com/search?q=org%3Acran+language%3Ar+%22xpath%22&type=code

Here are all CRAN functions using "xpath"... still not solid pattern:

https://github.com/search?q=org%3Acran+language%3Ar+%2F%28%5E%7C%5B%5Ea-zA-Z0-9%5D%29xpath%5Ba-zA-Z0-9._+%3C%3D-%5D%2Bfunction%2F&type=code

@AshesITR
Copy link
Collaborator

Thanks for doing the research. WDYT about xml_call_name()?

@MichaelChirico
Copy link
Collaborator Author

WDYT about xml_call_name()?

Not strongly opposed. Main worry is confusion vs {xml2} functions. Esp. if this grows to be a family of exported functions (there are already a few more private xp_* functions).

We also use xmlparsedata::xml_parse_data(). There, xml_parse could be the prefix (since they also export xml_parse_token_map) & matches the package name, so it's not as collided.

NEWS.md Outdated Show resolved Hide resolved
R/xp_utils.R Outdated Show resolved Hide resolved
R/xp_utils.R Outdated Show resolved Hide resolved
@AshesITR AshesITR merged commit 10c78f0 into main Aug 29, 2023
21 checks passed
@AshesITR AshesITR deleted the xp_call_name branch August 29, 2023 14:38
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.

Export xp_call_name()?
3 participants