NCAS-CMS / NCAS-CMS/cf-python

Replace `_numpy_allclose` in `cf.aggregate` and remove

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

During discussion today we noted that _numpy_allclose will (after #254) no longer be required by the Data modules, being replaced by efficient Dask logic in a new function in dask_utils.

Since the only remaining usage of it is in the aggregate module, we should replace that one use with potentially consolidated or more specific logic based on the requirements in that context, then remove _numpy_allclose. Potentially Data.equals or similar could be used to achieve this, but it remains to be seen.

(Raising as an issue because we are focusing on the Data side, so this isn't priority.)

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 with _numpy_allclose in cf/functions.py and trace its remaining use in the aggregate module. Read the surrounding aggregation requirements and the referenced dask_utils replacement, then confirm the context-specific logic works and that _numpy_allclose has no remaining users.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.