Skip to content

Pb ratio autocompute - #3

Open
marcodanielepellizzari wants to merge 2 commits into
mainfrom
pb-ratio-autocompute
Open

Pb ratio autocompute#3
marcodanielepellizzari wants to merge 2 commits into
mainfrom
pb-ratio-autocompute

Conversation

@marcodanielepellizzari

Copy link
Copy Markdown
Owner

No description provided.

207Pb/206Pb and 208Pb/206Pb are just 207Pb/204Pb and 208Pb/204Pb
normalized by 206Pb/204Pb, so only 3 of the 5 Pb ratios are actually
independent. Add compute_missing_pb_ratios() to derive whichever of
the 5 are missing from the ones present, whenever a row supplies at
least 3 (fewer than that isn't enough information; some "redundant"
triples still won't resolve everything, and are left as-is rather
than guessed).

Wired into both the upload preview (services.preview_rows) and the
actual import (services.import_rows), so what gets shown before
confirming matches what gets saved. The mapping step now also
mentions the rule, and the preview table highlights computed cells
with a tooltip explaining they were derived rather than read from
the file.
A row that supplies some Pb isotope data but can't be completed to all
5 ratios (see the previous compute_missing_pb_ratios commit) is now
excluded from the import entirely, both in the web wizard and the CLI
importer, rather than saved with partial Pb data.

The preview step (before confirming) already reports how many rows
would be discarded this way and highlights them in the sample table.
After a confirmed import, the dataset page shows how many rows were
rejected and offers a CSV download of their original, unmapped data
so the owner can fix and re-upload them; the CLI writes the same CSV
next to the input file instead.

Also fixes an unrelated URL-name collision found while testing this:
workflow/urls.py's DRF router registered its Dataset viewset with
basename="dataset", generating dataset-list/dataset-detail names that
silently shadowed datasets/page_urls.py's HTML views of the same name
-- every redirect("dataset-detail", ...) in the wizard was actually
sending users to the JSON API instead of the dataset page. Renamed to
basename="api-dataset" (unused anywhere else, verified by grep).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant