Skip to content

Antagomir - #335

Open
antagomir wants to merge 19 commits into
masterfrom
antagomir
Open

antagomir wants to merge 19 commits into
masterfrom
antagomir

Conversation

@antagomir

Copy link
Copy Markdown
Member

Added some updates based on CRAN build/check run.

antagomir and others added 7 commits September 13, 2026 20:09
Four URLs were reported as unreachable:

* The Eurostat copyright page under web/main/about/policies/ redirects to
  the ECAS login wall. Point at web/main/help/copyright-notice instead,
  which is served directly.
* The Eurostat API wiki (wikis.ec.europa.eu) moved behind ECAS login in
  its entirety, so the "API Statistics - data query" page can no longer
  be cited. Point at the public web-services landing page instead.
* GitHub returns 404 on /stargazers and /watchers for logged-out
  visitors, so the star and watch badges link to the repository front
  page instead.

README.md is regenerated from README.Rmd with rmarkdown::render(). This
also refreshes the search_eurostat() example output and picks up some
formatting differences from the local pandoc (3.1.11.1).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
Drops one entry from Imports, which has grown to 21 non-default packages
and triggers a CRAN check note. stringr was already imported and is a
thin wrapper around stringi, so the calls map one to one and the
performance characteristics that motivated using stringi over gsub here
are retained.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
Each of these is needed by exactly one optional code path, so importing
them unconditionally makes the package vulnerable to any of them becoming
unavailable for no benefit to users who never take that path:

* classInt   - cut_to_classes() with automatic breaks (not manual = TRUE)
* countrycode - label_eurostat(countrycode = ...)
* ISOweek    - eurotime2date() on weekly data

A new internal helper require_suggested() checks for the package and, if
it is missing, raises an error naming the package, what it is needed for
and how to install it.

With this and the preceding stringi change, Imports drops from 21 to 17
packages, below the threshold for the CRAN check note.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
For daily "YYYY-MM-DD" input the month and day were sliced at the wrong
character positions, producing strings such as "1990-01---31". Read them
from positions 6-7 and 9-10 instead.

The lenient parsing in lubridate::ymd() absorbed the malformed strings
when last = FALSE, so this went unnoticed, but with last = TRUE the
function errored out with "'from' must be a finite number": the shift
lookup has no entry for the daily time code and returned NA. A single day
already is the last day of the period it denotes, so it is now excluded
from the end-of-period adjustment altogether, as weeks already were.

Verified against all six time codes (Y, S, Q, M, D, W) for both values of
last.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
The man pages pick up the version bump to 4.1.1 in the auto-generated
citation blocks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
The package linked the copyright notice as both
.../eurostat/help/copyright-notice and
.../eurostat/web/main/help/copyright-notice. Both resolve, but carrying
two spellings for one page is needless drift. Converge on the shorter
form, which was already used in 18 of the 22 places.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqX4GsA4o265M8E56WRvVA
@pitkant

pitkant commented Sep 14, 2026

Copy link
Copy Markdown
Member

Ok I manually checked these and they seem sensible.

I was thinking about the number of Imports and of course 17 is better than 21 but the difference is not drastic. Additionally:

Moving ISOweek from Imports to Suggests breaks the following test:

Error (test_04_get.R:86:3): weekly dataset download (dissemination API) works correctly
Error: Package "ISOweek" is required for converting weekly Eurostat data into dates but is not installed.
Install it with: install.packages("ISOweek")
Backtrace:
    ▆
 1. ├─testthat::expect_match(...) at test_04_get.R:86:3

Moving classInt from Imports to Suggests produces the following message when building:

 ℹ Loading eurostat
✖ cut_to_classes.R:12: @details refers to un-installed package classInt.
✖ cut_to_classes.R:25: @seealso refers to un-installed package classInt.
✖ In topic 'cut_to_classes': @inheritParams failed because classInt is not installed.
Writing cut_to_classes.Rd
Documentation completed

and breaks the following test:

Error (test_07_misc.R:42:3): cut_to_classes works
Error: Package "classInt" is required for automatic class intervals in cut_to_classes() but is not installed.
Install it with: install.packages("classInt")
Backtrace:
    ▆
 1. ├─testthat::expect_visible(cut_to_classes(dataset$values)) at test_07_misc.R:42:3

Actually countrycode will anyway be loaded since eurostat package imports the regions package which imports countrycode so moving it to suggests in eurostat lowers the number but still ensures that countrywide is actually installed...

Actually I noticed that functions from these packages are not probably used if the user just uses default parameters for eurostat function calls, so making them optional should not result in constant nagging. I would still suggest that Claude reverses commit 72a6988 and turns ISOweek, classInt and countrycode back to Imports. The other option is to make these packages optional in documentation and tests like the sf and giscoR packages are optional now.

@antagomir

Copy link
Copy Markdown
Member Author

Done. If it seems too complicated I can just revert the whole thing to what it was.

"Found the following (possibly) invalid URLs:
[...]
from README.md
Message: Invalid URL: '#' not allowed in fragment"
@pitkant

pitkant commented Sep 15, 2026

Copy link
Copy Markdown
Member

For some reason when I rebuild docs on my computer (R version 4.6.1) the printed version of the citation has a dot between "https://doi.org/10.32614/CRAN.package.eurostat" and "R package version" whereas documentation built on your computer has a comma between those. Weird.

I re-ran the tests on win-release and win-devel and removed Gitter links from the README.md file for the CRAN release. I think we can re-add them after submitting, although Gitter is not used that much (at all).

@antagomir

Copy link
Copy Markdown
Member Author

Maybe we can just remove Gitter? Should we activate the Github "Discussions" tab? That provides a forum in case someone needs. The link could be updated accordingly.

@antagomir

Copy link
Copy Markdown
Member Author

Weird thing with period vs. comma.. what shall we do with that..?

@pitkant

pitkant commented Sep 15, 2026

Copy link
Copy Markdown
Member

I don't know if GitHub discussions has a separate button we could include but I can add a link to Discussions.

ChatGPT suggested that it might be related to R version and R package versions related to printing the output (so R version since we use the bibentry function from built-in utils package) or more likely system locale. Mine is

> Sys.getlocale()
[1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"

so it's not a big deal but just annoying since the citation is included in so many help files (because it makes software citations more likely than just burying it in eurostat-package).

@antagomir

Copy link
Copy Markdown
Member Author

Now good? This was R build version issue.

@pitkant

pitkant commented Sep 16, 2026

Copy link
Copy Markdown
Member

Everything seems to be in order now. I think it's ready for release.

Only thing I wonder if whether we should squash all the commits in this PR into one 4.1.0 release since these versions after 4.1.1 have been very minor improvements that, in my opinion, don't even deserve to be documented in NEWS.md. But going forward with 4.1.4 as the CRAN release version is fine by me as well, maybe we could add a new NEWS section for 4.1.4 that pulls everything together.

@antagomir antagomir left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok done - ok to submit now?

This branch has not been deployed

No deployments
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