nasa / nasa/python_cmr

very small numbers get written into URLs with error-raising scientific notation

Open Beginner friendly
#108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
29
Forks
32
Avg merge
19h 6m
Merged PRs (30d)
1

Description

A very small number, for instance a coordinate very close to the equator, can get written to string as scientific notation when cmr.queries.Query._build_url() is called. For example:

from cmr import GranuleQuery

q = GranuleQuery().short_name("FOO").point(42, 0.00001)
q._build_url()
'https://cmr.earthdata.nasa.gov/search/granules.json?short_name=FOO&point[]=42.0,1e-05'

To this request, CMR responds:

{"errors":["[42.0,1e-05] is not a valid URL encoded point"]}

Contributor guide

No contributing guide indexed for this repository

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 at cmr.queries.Query._build_url() and reproduce the issue with the GranuleQuery example using a very small coordinate. Trace how the point value is converted into the URL, then verify that the generated point avoids error-raising scientific notation and is accepted by CMR.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.