NCAS-CMS / NCAS-CMS/cf-python

Object equality: doctest-able examples covering special cases

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

Nobody has claimed this yet.

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

Description

There is a lack of concrete examples in the API reference across the equals methods available on the various construct and data objects (see e.g. the end of the references here and here) so during #254 we agreed it would be good to add in a good range of examples, ideally eventually doctest-able (i.e. inclusive of set-up of the objects referred to), which in the process of verifying and documenting should enable us to ensure behaviour is known and consistent in relation to such aspects as:

  • management of self-equality (a.equals(a)) and whether to short-circuit on copies (a.equals(a.copy()));
  • handling of subtleties of data (including relevant keywords to toggle these), e.g: how to deal with masked arrays, NaN values, different data types with equivalent data, compression etc.;
  • handling of potential subtleties of metadata (not explored so much as with the above in #254, but I don't doubt there are some).

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

Review the equals API references linked in the issue and the decisions from #254 first. Inventory the construct and data object equals methods, then define doctest-able examples covering self-equality, copies, masked arrays, NaN values, data types, compression, and metadata. Done means the documented examples can be run as doctests and the relevant behaviours are explicit and consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, testing-qa
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.