Repository navigation
Fix issues #4 to #10 - #16
Merged
Merged
Conversation
Database exports name fields with the hour (attached_thermometer_7am) and also give it in the date/time column (07:00). The two were joined into "attached_thermometer_7am 07:00", which could not be read as a time, so every fixed-hour reading was written as a daily value. When the joined name can't be read and the field name ends in a clock time (7am, 2pm, 9:00) or a named time (sunrise, noon), the name is now read without it and the time column is used. If they disagree, check reports it and the time column is used. Bare numbers (casual_phenomena_line_2, barometer_observed_117, ..._9pm_1) are not taken as times. Aliases that include the hour (the earlier workaround) still work as before. Checked on York Factory 1876 and Red River Settlement 1844-61: metadata without the hour in the aliases now gives SEF files identical to the workaround. New test: test_hour_in_field_name. Fixes #4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
The description joined the characters of the single Author-email string
("Authors: V, i, c, k, y, ..."). It now reads the names from it:
"Authors: Vicky Slonosky, Hervé Hacot." --help and --version also work
when csv2sef is run from the source folder without being installed.
New test: test_help_authors.
Fixes #5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
pyproject.toml (shown by --help and on PyPI) and the README author line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
These values were reported as unmapped in direction columns: - -999 (and -999.9) is now missing, and -888 an instrument error, as in number columns. - "hidden" (also obscured, haze, fog, smoke, mist): fog or thick lower clouds hide the higher clouds, so their direction can't be seen. Value missing, flag "hidden" (Table 5 of the paper). - "clear" in a cloud-direction column: no clouds. Same value as "none" (Calm), flag "no clouds". In a wind-direction column it stays unmapped. York Factory 1876: the 256 unmapped "hidden" values are now flagged hidden. Red River 1844-61: unmapped values drop from 324 to 165 (the rest are weather remarks and a few transcription notes such as "empty 0"). New test: test_direction_values; three known values added. Fixes #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
In cloud-direction and cloud-type columns (cd, hd, c, cl, ch), "none" now means no clouds, as "clear" does: Calm with flag "no clouds" for a direction, Cl0 / Ch0 for a cloud type (Table 5: None; Clear = 0). In every other column "none" stays a missing value (Table 7). Tests and known values added. Part of #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
In cloud-amount columns (n, nl, nh, hl), in tenths or oktas, "none" now
means no clouds = 0, as in cloud-direction and cloud-type columns.
Clearness of sky (skc) is left as missing: there "none" could mean no
clear sky. Other columns are unchanged ("none" = missing).
Part of #7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
Some registers give wind direction and force in one cell ("south 1",
"north-west 2"; Red River Settlement 1844-45). The direction part was
already read in direction columns, but the force was marked invalid
because the Smithsonian / Beaufort converters tried to read "south" as a
number. When a force cell starts with a compass direction, the number
after it is now used, and the log notes it.
Red River Settlement 1844-61: 688 of the 691 invalid wind forces are now
converted (the other 3 invalid values are transcription notes).
New test: test_direction_and_force.
Fixes #6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
- Wind forces with a fraction ("south-east 1/2", "2 1/2"): the Smithsonian
and Beaufort scales have no fractions, so the force is rounded down and
flagged "fraction rounded down" (it was rounded down silently).
- "redacted" (text struck through in the register) is a missing value.
Part of #6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
A header typed with a tab after each comma (easy to get in a text editor) made csv2sef read the whole file as tab-separated, so the first column was called "Date," and the error was "no date columns found". The separator (comma, semicolon or tab) is now judged from the header and up to five data lines, so the data decide. Stray tabs in header names are then removed by the usual clean-up. The "no date columns" error now lists the columns it read and suggests checking the separators. New test: test_separators. Fixes #8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
A barometer column marked [mm] (meaning mmHg) was read as millimetres of
precipitation: no conversion to hPa, and every value flagged as low
pressure. For pressure and vapour-pressure variables, a length unit (mm,
in) is now read as millimetres / inches of mercury, and check says so
("unit 'mm' read as mmHg ...; write [mmHg] to avoid this note"). The same
applies to units given by unit_change. Rain and snow are unchanged.
Hebron 1883 with [mm] headers: 0 flagged values instead of 358.
New test: test_mm_on_pressure.
Fixes #9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
Values in a unit_change period were converted correctly, but the check
table only showed the column's main unit. Each column now lists the
unit_change lines that apply to it, with the number of values affected:
Air_Temperature 08:00 [R] ta 08:00 R header C ...
> unit De_frz from 1742-11-01 to 1753-12-31 (unit_change): 1746 value(s)
New test: test_unit_change_in_check.
Fixes #10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC13ToxZ7NuJEZJX9urApc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One commit per issue; each says 'Fixes #n', so issues #4 to #10 close when this is merged. All tests pass on Python 3.10 and 3.14.