Skip to content

Provide user-friendly way of loading/attaching the hySpc.* packages #218

Closed

Description

@cbeleites

I.e., a function that attaches (amost) all installed packages of the hySpc.* family.

Exceptions would be

  • hySpc.testthat which IMHO shoud not be attached automatically (the more so as testthat masks some
  • Should hySpc.dplyr be an exception as well? It masks e.g. stats::filter() with totally different functionality.
    (but then filter() is always a particularly troublesome function, since there's also signal::filter())?

Activity

  1. added this to the Version 1.0 milestone on Jul 18, 2020
  2. self-assigned this
    on Jul 18, 2020
  3. added
    Type: question ❔
    on Jul 18, 2020
  4. added a commit that references this issue on Jul 18, 2020
    55cfa9a
  5. cbeleites commented on Jul 19, 2020

    @cbeleites
    OwnerAuthor

    @GegznaV (in the discussion of PR #219)

    1. I recommend following the **tidyverse** style code and use all lower case letters in **function** names.
    
    2. I'd prefer the word `load` over `attach`. Yet `attach` would be a more precise term (as packages are loaded and attached).
    
    3. I think it's better to have several functions of this type. Related to this functionality and they should have the common prefix `hyspc_`, e.g (just ideas to illustrate my point):
       
       * `hyspc_load_all()` or `hyspc_attach_all()`
       * `hyspc_load_main()`
       * `hyspc_load_manipulation()`
       * `hyspc_load_tidyverse()` (ggplot + dplyr)
       * `hyspc_load_read()`
       * `hyspc_packages()`
       * `hyspc_update()`
       * `hyspc_generate_installation_code()`
       
       Even if we decide to have only a single function, I'd prefer `hyspc_load()` over `load_hyspc()` or `hyspc_attach()` over `attach_hyspc()`
    
    1. IMHO it would be very confusing if users replace library(hySpc.something) with uppercase S by lowercase hyspc_load(). I vote for hySpc always having the exactly same spelling.

    2. I don't have a strong preference wrt. attach vs. load. I'd prefer attach_hySpc() over hySpc_attach() since I was told that one recommendation in technical writing is to start with the most precise verb one can come up with - so I try to apply this also to variable names.
      Further opinions?

    3. I'd prefer to supply one function for attaching/loading, but I'm fine with parameters to switch on/off certain "types" of packages. Easiest would we hySpc.read.anything, since that can be done by a pattern on the package name.

      Wrt. further groups of packages such as tidyverse: maintaining lists of package names here is fragile and causes ongoing work: we'd need to maintain this function whenever a new hySpc package appears. Instead, I suggest that we either

      • add a further group to our package name scheme (e.g. hySpc.dplyr -> hySpc.tidyverse.dplyr or hySpc.tidy.dplyr, hySpc.manip.matrixStats)
      • or not provide such a granularity in load/attach helper functions.

    As for installation and update helpers, @GegznaV please open separate issues for them.

  6. added
    Note: poll ⬆️ ⬇️
    on Jul 19, 2020
  7. bryanhanson commented on Jul 19, 2020

    @bryanhanson
    Collaborator

    On attach vs load: The typical end user doesn't have much experience with attach, they may have seen load but really they just use library and don't worry about what's going on in the background. I wish to make a plea for the novice end user: Just let them use library("xyz") several times if needed. I know someone argued against this (can't recall who, where) but it's really not that hard to put in a script, and the user and anyone else coming along later has a clear understanding of what was loaded and presumably why.

    I've argued this before elsewhere: I thought a major goal of the summer work was to make hyperSpec easier to maintain and simplify things. In particular, break things out into sub-packages so that user could install and load just what they need. Now we seem to be doing the opposite: encouraging users to load them all. True, I'm mixing the steps here a bit, the argument seems to be attach anything already installed, not install everything. Still, just use library several times.

    My preference would be to close this issue w/o action or at least put on hold. This issue seems to escalating in complexity with little practical gain. We have other more pressing issues.

  8. cbeleites commented on Jul 19, 2020

    @cbeleites
    OwnerAuthor

    very good points, @bryanhanson

  9. GegznaV commented on Jul 20, 2020

    @GegznaV
    Collaborator

    IMHO it would be very confusing if users replace library(hySpc.something) with uppercase S by lowercase hyspc_load(). I vote for hySpc always having the exactly same spelling.

    I have 2 main preferences (goals) in choosing function names:

    1. consistency in naming strategy,
    2. function names contain only lower-case letters, digits, and underscores (complies with the Tidyverse style). Except for the cases where methods for generics from other packages are created (e.g., for as.data.frame).

    To achieve consistency, upper-case letters in the new package names (hySpc.*) from time to time require function names in these packages to have upper-case letters. So at least one of the above-mentioned principles should be violated. As a consequence, I'd still prefer to rename the packages to have only lower-case letters only (maybe, with the exception to hySpc.testthat, as it's already on CRAN). In this way, there would be no conflict in naming conventions.


    About the other raised points, I agree with @bryanhanson that we should not discuss them now. It would be better to do that after all the packages planned for the summer school are implemented.

  10. cbeleites commented on Jul 24, 2020

    @cbeleites
    OwnerAuthor

    We decided in the video call that

    • package names should stay as they are
    • for now, package loading functions are a convenience that is low priority.
  11. removed this from the Version 1.0 milestone on Jul 24, 2020
  12. added and removed
    Note: poll ⬆️ ⬇️
    Type: question ❔
    on Jul 24, 2020
  13. bryanhanson commented on Jul 24, 2020

    @bryanhanson
    Collaborator

    I made a note in Trello as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions