mapbox / mapbox/raster-tester

Modify "not ok" behavior

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

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The purpose of raster-tester is to ask yes/no questions about raster data. If the answer is no, that's not an exception, it's just one of the possible expected outcomes. We should specify this behavior in more detail to standardize it.

The following is just a proposal, would love to get feedback/discussion before we start implementing.

If the answer to the question is **no**:
- the _function_ should return a tuple with boolean and a message like `(False, "These rasters are bad and they should feel bad")`
- the _click command_ should print the message (to stderr or stdout?), along with the rasters that were being evaluated, `not ok: a.tif vs b.tif (These rasters are bad and they should feel bad)`
- the _click command_ should exit with code 1

If the answer to the question is **yes**:
- the _function_ should return a tuple with boolean and a message like `(True, "These rasters are perfect in every way")`
- the _click command_ should print the message to stdout, along with the rasters that were being evaluated, `ok: a.tif vs b.tif (These rasters are perfect in every way)`
- the _click command_ should exit with code 0

cc @sgillies @dnomadb

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 existing raster-tester function and Click command, then trace how yes and no results are currently returned, printed, and converted to exit codes. The work is done when both outcomes return the specified boolean and message, the command prints the raster pair and status consistently, and exits with code 0 or 1 as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.