Skip to content

Package naming "conventions" for xarray extensions #1447

Closed

Description

@benbovy

I'm wondering what would be a good name for a package that primarily aims at providing an xarray extension (in the form of a DataArray and/or Dataset accessor).

I'm currently thinking about using a prefix like the scikit package family (e.g., scikit-learn, scikit-image).

For example, for a xarray extension for signal processing we would have:

package full name: xarray-signal
package import name: xrsignal (like sklearn)
accessor name: signal.

>>> import xarray as xr
>>> import xrsignal
>>> ds = xr.Dataset()
>>> ds.signal.process(...)

The main advantage is that we directly have an idea on what the package is about. It may be also good for the overall visibility of both xarray and its 3rd-party extensions.
The downside is that there is three name variations: one for getting and installing the package, another one for importing the package and again another one for using the accessor. This may be annoying especially for new users who are not accustomed to this kind of naming convention.

Conversely, choosing a different, unrelated name like salem or pangaea has the advantage of using the same name everywhere and perhaps providing multiple accessors in the same package, but given that the number of xarray extensions is likely to grow in a next future (see, e.g., the pangeo-data project) it would become difficult to have a clear view of the whole xarray package ecosystem.

Any thoughts?

Activity

  1. jhamman commented on Jun 15, 2017

    @jhamman
    Member

    @benbovy -

    I don't have really strong opinions here but I can tell you what I've done with xmap. I basically tried to keep it simple and use the same name for all three (package full name, package import name, and the accessor name). My thoughts on how to handle longer names are generally the same, the package-full name could be anything (I'd be okay switching to xarray-mapping) and I like the idea of having an identifiable collection of extensions (+1 for xarray prefix). My gut reaction to xrsignal is to drop the r (xsignal) and perhaps to use xsignal as the accessor name as well. Just some thoughts and like I said, no strong opinions here.

  2. darothen commented on Jun 16, 2017

    @darothen

    For xbpch I followed a similar naming convention based on @rabernat's xmitgcm. Brewing on the horizon is an xarray-powered toolkit for GEOS-Chem and while it'll be a stand-alone library, I imagine it'll belong to this confederation of toolkits and provide an accessor or two for computing model grid geometries and related things on-the-fly. I'd also +1 for an xarray prefix (so, xbpch -> xarray-bpch and xmitgcm -> xarray-mitgcm?)

  3. benbovy commented on Jun 19, 2017

    @benbovy
    MemberAuthor

    I like the idea of using only the x prefix for both the package-import name and the accessor. xr doesn't look very nice as a prefix with no underscore. Maybe having the x prefix for the accessor as well would also differentiate 3rd-party accessors from xarray-specific accessors like dt?

    I don't have strong opinions on this either.

  4. spencerahill commented on Jun 19, 2017

    @spencerahill
    Contributor

    One other thought for x rather than xr: to me at least, the x-prefixed package names just sound cool 😄

  5. stale commented on May 29, 2019

    @stale

    In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

    If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions