Skip to content

Removed make, static datasets, Rmd vignettes, enabled CI and pkgdown - #153

Closed
GegznaV wants to merge 143 commits into
cbeleites:developfrom
GegznaV:change-package-structure-devel
Closed

GegznaV wants to merge 143 commits into
cbeleites:developfrom
GegznaV:change-package-structure-devel

Conversation

@GegznaV

@GegznaV GegznaV commented Jun 12, 2020 •

Copy link
Copy Markdown
Collaborator

This PR contains huge changes to the following areas:

  1. UPDATE: partially replaced by PR Feature/131 Enable R-CMD-check on Git-Hub Actions #159.
    Make is totally removed (closes Get (mostly) rid of make #132). Now package could be built by using tools that are integrated with RStudio (devtools, etc.)

  2. UPDATE: replaced by PR Feature/131 Enable R-CMD-check on Git-Hub Actions #159.
    Datasets.
    a) the small datasets and dataset chondro are converted to static versions. This addresses most of the issues Convert small data sets to "static" versions #137 (I checked the boxes in Convert small data sets to "static" versions #137 that are completed and others may be polished later).
    b) all raw datasets (and other contents of "fileio" folder, which was used to build fileio.Rnw vignette) are moved to the "raw-data" folder which is .Rbuildignored. Only copies of raw data that are needed to build flu and laser vignettes are copied to inst/extdata folder. Now the files of the package (except the contents of the "raw-data" folder and most .gitignored files, e.g., the raw text data for chondro dataset) take about 5-6 MB on my PC.

  3. UPDATE: replaced by changes in PR Feature/78, 79, etc. Vignettes translated to R Markdown #147.
    Vignettes:
    a) Vignettes are translated from Rnw to Rmd (taken from PR Feature/78, 79, etc. Vignettes translated to R Markdown #147) and Rnw files are removed (closes Translate vignettes from Sweave to R Markdown #79). But further rearrangement of contents and polishing of other details are necessary.
    b) Some R code in fileio.Rmd vignette is still temporarily disabled. I think it is more reasonable to continue working on this vignette when the package structure does not contain make.
    c) Vignettes are moved to the package's vignettes folder (closes Move vignette *hyperSpec* #135, closes Move vignette *plotting* #136).
    d As Rnw files are removed I think fileio.Rnw chunk readcollapse has an error #119 gets not relevant so may be closed too.

  4. UPDATE: replaced by changes in PR Feature/78, 79, etc. Vignettes translated to R Markdown #147. On-line documentation. GitHub Actions are set to build pkgdown website (takes ~11 min.; closes Feature request: online documentation with pkgdown or similar #78) and some pkgdown configuration files are created. Later we will be able to customize the documentation even more.

  5. UPDATE: replaced by PR Feature/131 Enable R-CMD-check on Git-Hub Actions #159.
    Continuous integration (CI). CI is enabled and R-CMD-check passes on:

    • Windows + R devel version (it is set to fail on errors only for R-devel)
    • Windows + R current version (it is set to fail on warnings for R current and old release)
    • macOS + R current version
    • Ubuntu + R current version
    • Ubuntu + R old release

    image

    The whole R-CMD-check on this matrix of options takes ~ 14 minutes. This ensures that my changes do not break anything in the package (closes Use Continuous Integration (CI) service to automatically check hyperSpec package #131). On my local machine, R-CMD-check returns only one issue related to folder sizes:
    image

    • data 2.0Mb is related to chondro dataset as it is almost this big. The new fauxCell dataset will solve this issue.
    • I do not know the true cause of the doc 2.2Mb issue, but I think that this is related to large figures in current Rmd vignettes (the size could be fixed later).

GegznaV and others added 30 commits January 2, 2020 04:21
Translated to Rmd
Translated to Rmd
The slot @log was deprecated and not in use for at least 10 years. We met a decision to permanently remove it from hyperSpec, and thus it should be not be mentioned in the vignette as well.
Merge pull request #1 from ximeg/translate_vignettes
@GegznaV
GegznaV requested a review from cbeleites June 12, 2020 01:06
@GegznaV

GegznaV commented Jun 12, 2020 •

Copy link
Copy Markdown
Collaborator Author

By the way, I'm not sure if it worth checking each commit that is related to vignettes and GitHub Actions setup files as there was some experimentation and moving back and forth.

The most radical changes were in commit c677f50 "Changed structure of package" an onwards.

Comment thread .gitignore
*.idx
*.ind

hyperSpec/NAMESPACE

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

NAMESPACE and man/*.Rd are auto-generated by roxygenize() and they are therefore redundant, i.e. the primary source is not there but in the Roxygen comments.

Can they stay ignored and instead be generated also during the actions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

At some point, there were problems with pkgdown and ignored "man/*.Rd". I will check on a separate branch if these files can stay Git-ignored.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

  1. man/*.Rd can be safely git-ignored: R-CMD-check and pkgdown building are successful.

  2. Unfortunately, if both NAMESPACE and vignettes/*.html files are missing, step of Roxigenation (devtools::document()) fails. There is the result on my local machine:
    image
    And the results on GH Actions
    And if I run document() function several times in console, I get an additional warning:
    image
    Does the last warning give any helpful information for you, @cbeleites?

    I have to run Roxygenation + building steps several times locally before the process is successful. And I did not manage to solve this issue for the GitHub Actions setup is NAMESPACE is missing. This might be a bug in devtools::document() or somehow related hyperSpec (e.g., non standard usage of testthat).
    But if NAMESPACE file is present (even incomplete), the issue disappears, R-CMD-check passes (this is the same link as in point 1).

Would it be ok if we Git-ignored man/*.Rd but tracked changes in NAMESPACE?

@cbeleites

Copy link
Copy Markdown
Owner

I think this pull request would put the spectra files that are currently under git lfs into the "normal" git repo.
I'd very much prefer to avoid this.

(when checking, I found that some of the spectra files are accidentally under normal git rather than git lfs - but I think I can take care of this when transferring hyperSpec from https://github.com/cbeleites/ to https://github.com/r-hyperspec once the big files are distributed to the import packages)

@cbeleites

Copy link
Copy Markdown
Owner
  • Would it be possible to keep the top-level directories hyperSpec/ and Vignettes/ for now?
    If that's too much hassle with the github actions,
  • I suggest to delete the fileio vignette and the respective files. We still have them in other branches (I can make an "old-vignettes" branch off devel before merging this in) and can sort them into the new packages from there.

@GegznaV

GegznaV commented Jun 12, 2020

Copy link
Copy Markdown
Collaborator Author

I think this pull request would put the spectra files that are currently under git lfs into the "normal" git repo.

I have no experience with git lfs so I might have done something wrong for git lfs. I need more guidance on what should be corrected.

Would it be possible to keep the top-level directories hyperSpec/ and Vignettes/ for now?

Why do we need this? Is it for git lfs?

@cbeleites

Copy link
Copy Markdown
Owner

yes - I quickly tried to find out how to move files in git lfs (so we could have them in vignettes-old or so and then .Rbuildignore that) but did not succeed. If I move them in normal git, they are not recognized any more. And changing the path in .gitattributes is not sufficient.

But directory Vignettes/ would conflict with vignettes on Windows...

@cbeleites

Copy link
Copy Markdown
Owner

I don't know whether you did anything really wrong. It may just be caused by your github account not having git lfs enabled.
I'll think about how to solve this.

From "https://git-scm.com/docs/gitattributes":
> The rules by which the pattern matches paths are the same as in .gitignore files [...], with a few exceptions:
> [...]
> - patterns that match a directory do not recursively match paths inside that directory (so using the trailing-slash path/ syntax is pointless in an attributes file; use path/** instead)
@GegznaV

GegznaV commented Jun 14, 2020

Copy link
Copy Markdown
Collaborator Author

On branch GegznaV:change-package-structure-devel in RStudio Terminal, I ran:

git lfs ls-files

image

On branch cbeleites:develop the same command returns a much larger list of files.

@GegznaV

GegznaV commented Jun 14, 2020

Copy link
Copy Markdown
Collaborator Author

@cbeleites, I'm not sure if it is serious...

I was trying the GIT LFS commands from this section https://github.com/git-lfs/git-lfs#example-usage After I tried the following command, I was not able to push or pull any commits anymore due to unmatching history of commits (800+ commits appeared to push and to pull).

git lfs migrate import --include="raw-data/*" --everything 

The output in Terminal:

image

Now I think that command affected all local and remote branches of repository and I shouldn't have used --everything flag and maybe should use some other flags that were not present in these examples.

Now here I found that:
image


On my machine, I solved the issue by deleting (renaming) current folder with hyperSpec project and cloning it again from the remote.


Sorry for this. I didn't expect that the code could affect anything on other branches than change-package-structure-devel.

@GegznaV

GegznaV commented Jun 14, 2020

Copy link
Copy Markdown
Collaborator Author

Related to commit 54ec4d5 ("Put directory "raw-data" under LFS"):

@GegznaV

GegznaV commented Jun 15, 2020

Copy link
Copy Markdown
Collaborator Author

Would it be possible to keep the top-level directories hyperSpec/ and Vignettes/ for now?
If that's too much hassle with the GitHub actions,

@cbeleites, it was not as straightforward as I thought, but after 2 hours of trial and error, finally, I managed to change the working directory that is used for R-CMD-check and pkgdown on GitHub Actions. With these settings, we can keep both hyperSpec/ and Vignettes/ directories.

I will create a new pull request that, hopefully, will not remove the files from Git LFS (I won't touch the "./Vignettes" directory) and all my changes will go to "./hyperSpec" folder. Just before I move my changes to a new fork, we should decide what additional changes to this pull request are needed:

  1. Is it OK, if we start tracking changes in NAMESPACE? The issue is described here: Removed make, static datasets, Rmd vignettes, enabled CI and pkgdown #153 (comment)
  2. I think we should keep fileio.Rmd vignette for now. We can remove it later.
  3. Any other suggestions?

I also want to know if @bryanhanson has any uncommitted or not pushed changes to the branch feature/vignettes-in-rmd. I think we should synchronize the contents in develop and feature/vignettes-in-rmd branches before and after merging this pull request (it is based on branch feature/vignettes-in-rmd) to avoid some conflicts in the future.

@cbeleites

Copy link
Copy Markdown
Owner
  1. ultimately, tracking NAMESPACE should not be required. However, I found that I sometimes have to run document() twice - but I'm not yet sure under which conditions.
  2. OK, sure -> that was only a "last resort" suggestion
  3. the error looks as if we're missing an @import. I'll have to look into this.

@GegznaV
GegznaV marked this pull request as draft June 16, 2020 11:58
@GegznaV GegznaV closed this Jun 16, 2020
@GegznaV
GegznaV deleted the change-package-structure-devel branch June 16, 2020 16:44
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.

3 participants