EarthMind rejects valid readings whose value is 0
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in _ingest_reading in earthmind/src/index.py (around line 127), where the required-field check uses a truthiness test that rejects 0. Read the README's API Reference and Running Tests sections, then check how env.DB is used so you can build a small fake for the new earthmind/tests/test_ingest.py. Done when POST /api/data accepts value: 0, rejects NaN, Infinity and out-of-range coordinates with 400, and python -m pytest tests/ passes.
Written by the indexing model from the issue text.
Description
Context
_ingest_reading in earthmind/src/index.py (~line 127) checks required fields with:
missing = [f for f in required if not body.get(f)]
Because 0 is falsy, a perfectly valid reading such as {"parameter": "rainfall", "value": 0, ...} is rejected with 400 Missing required fields: value. Zero is a common real value (rainfall, wind speed, many pollutant readings at night). The same check also accepts "nan" / "inf" strings, because float("nan") succeeds.
What to do
- Treat a field as missing only when it is absent,
None, or an empty string. - Reject non-finite values (
math.isfinite) with a 400. - Validate
latitudein [-90, 90] andlongitudein [-180, 180] when provided. - Add tests (new
earthmind/tests/test_ingest.pywith a tiny fakeenv.DB) for value 0, missing value, NaN, and out-of-range coordinates.
Acceptance criteria
- POST
/api/datawithvalue: 0returns 201. - NaN/Infinity and invalid coordinates return 400.
- New tests pass with
python -m pytest tests/.
Files
earthmind/src/index.py (_ingest_reading)earthmind/tests/ (new test file)
Helpful links
- earthmind/README.md (API Reference, Running Tests)
Part of GSoC 2027 onboarding — see https://gsoc.alphaonelabs.com
- Dominant language
- HTML
- Stars
- 66
- Forks
- 181
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alphaonelabs/website
-
Rewrite the gsoc/ README for the current site and 2027Possibly taken @KanishJebaMathewM claimed this 2 days ago. Open2026-11 documentation good first issue gsoc-2027 project: gsoc
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alphaonelabs/website#1154 · 1 comment ·
Maintainers usually reply within 1 day
-
Add unit tests for the virtual campus layout logicPossibly taken @KanishJebaMathewM claimed this 2 days ago. Open2026-11 good first issue gsoc-2027 project: virtual tests
Difficulty 2/5 Half a day Newbie friendliness 82/100
alphaonelabs/website#1150 · 1 comment ·
Maintainers usually reply within 1 day
-
Don't let Mockuper's shortcuts hijack undo and delete while typing in a fieldPossibly taken @bfs2021 claimed this 2 days ago. Open2026-11 bug good first issue gsoc-2027 project: mockuper
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alphaonelabs/website#1147 · 1 comment ·
Maintainers usually reply within 1 day
-
Update BotLab's README and CONTRIBUTING for the monorepo and live sitePossibly taken @KanishJebaMathewM claimed this 2 days ago. Open2026-11 documentation good first issue gsoc-2027 project: botlab
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alphaonelabs/website#1144 · 1 comment ·
Maintainers usually reply within 1 day
-
Fix PMOSS docs: broken code blocks, stale repo URLs and database namePossibly taken @KanishJebaMathewM claimed this 2 days ago. Open2026-11 documentation good first issue gsoc-2027 project: pmoss
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
alphaonelabs/website#1139 · 1 comment ·
Maintainers usually reply within 1 day
All issues in alphaonelabs/website
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/maven-enforcer#1074 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
paperclipai/paperclip#19120 ·
Maintainers usually reply within 1 day
-
area/ambient
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
CLI
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cline/cline#15550 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
jjjonesjr33/petlibro#297 ·
Maintainers usually reply within 4 days