NCAS-CMS / NCAS-CMS/cf-python

Support selected new `numpy`-consistent `Data` methods

Open
#328 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API review (4.0.0) dask enhancement
Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

After or during the LAMA to Dask conversion (#182) we should review the Data methods we support, especially because LAMA didn't yet support binary operations in a performant way, but Dask enables those, and particularly also for data operations like mathematical functions where we don't seem to have very good coverage relative to the possible methods supported by NumPy (see ours vs. numpys).

The following can be used as a list of methods to add, or to prioritise adding; please add to the list as appropriate, particularly with user requests or where a method seems particularly useful in the context of cf to add (try to include some contextual notes):

  • arctan2: already largely coded up but commented out as it is a binary operation and therefore was not possible to do in a performant way with the current LAMA (see #38);
  • sqrt: user request by @bnlawrence (I pointed out f**0.5 works for this, etc., but the method form was preferred and requested);
  • cbrt: why not add if we are adding the above anyway, where all other more niche roots can be covered by the ** operator;
    ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the LAMA-to-Dask conversion in #182 and the existing commented-out arctan2 implementation, then compare cf.Data’s mathematical-functions documentation with NumPy’s routines. Prioritise the requested arctan2, sqrt, and cbrt methods, and consider the work done when the selected methods are supported consistently with NumPy and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.