Giter VIP home page Giter VIP logo

Comments (2)

dgilford avatar dgilford commented on August 12, 2024

Hi Ryan,
Thank you!

This is a great point. In retrospect, I probably need to adjust how requirements.txt is created so that it only references the package folder... not the full set of examples and sample runs.

Daniel Rothenberg suggested the use of apply_ufunc in run_sample.py, so it is adapted there, but is not a stand-alone tool within the padckage.

I don't know exactly what a "compatibility layer" is (this being my first foray into this kind of project, I'm still learning), but it sounds really useful. Is it basically a go-between function that allows the user to directly pass xarray data in and out of the main function, but within the package itself? A tool like this could be very helpful!

from tcpypi.

rabernat avatar rabernat commented on August 12, 2024

Is it basically a go-between function that allows the user to directly pass xarray data in and out of the main function, but within the package itself? A tool like this could be very helpful!

Yes exactly. In this module from fastjmd95, we have just a quick bit of code (in the form of a decorator) that checks whether the user is passing a regular numpy array, a dask array, or an xr.DataArray. For the later two, it does a little something extra to "wrap" the call to the underlying numba function (which operates only on raw numpy arrays).

In your case, this logic would need to be a bit more complex, since you treat the vertical axis specially. But the same basic pattern would still apply.

The benefit for the user is that they never have to "leave" xarray.

from tcpypi.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.