DK support multiple years - #258
Open
ivorbosloper wants to merge 1 commit into
Open
ivorbosloper wants to merge 1 commit into
ivorbosloper wants to merge 1 commit into
Conversation
This was referenced Sep 11, 2026
ivorbosloper
force-pushed
the
split/dk
branch
2 times, most recently
from
September 12, 2026 15:10
f482379 to
474f66b
Compare
Marknr numbers a field within one application, so on its own it repeats across holdings — 38 of 100 sampled 2026 rows shared one. From 2014 the source names the application (Journalnr) and the pair identifies a field; where the application is missing (70 of 599,008 rows in 2015, the worst edition) the id is left empty and the row is dropped downstream, rather than every such row sharing an id of "nan". The older editions name the applicant instead — Ansoeger until 2011, KUNDE_LB in 2012 and 2013 — and that pair genuinely repeats: 5,124 keys cover 11,534 of the 678,347 fields of 2008, mostly distinct polygons of distinct size. Nothing there identifies a field, so the row index does, which is safe because an edition is one file. 2008 and 2009 carry no crop columns at all. The HCAT mixin now returns the frame untouched when an edition has none, instead of failing on a column it cannot find, so those two convert as boundaries. A fixture for 2008 covers the older shape, through an entry of the form "<id>#<label>" that runs a second edition of one converter from the same folder of input files. Nineteen editions (2008-2026) are built and published, 11.4M field-years. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
ivorbosloper
force-pushed
the
split/dk
branch
from
September 12, 2026 16:12
474f66b to
bec3200
Compare
m-mohr
reviewed
Sep 17, 2026
Comment on lines
+38
to
+42
| if "Journalnr" in gdf.columns: | ||
| key = gdf["Journalnr"].astype(str) + ":" + gdf["Marknr"].astype(str) | ||
| gdf["id"] = key.where(gdf["Journalnr"].notna() & gdf["Marknr"].notna()) | ||
| else: | ||
| gdf["id"] = gdf.index |
Contributor
There was a problem hiding this comment.
Question as usual: Should the IDs be consistent over years?
m-mohr
reviewed
Sep 17, 2026
| gdf["id"] = gdf.index | ||
|
|
||
| if "Afgkode" in gdf.columns: | ||
| gdf["Afgkode"] = gdf["Afgkode"].astype(float).fillna(value=0).astype(int).astype(str) |
Contributor
There was a problem hiding this comment.
This looks suspicious: float -> int -> str? Why two different numerical types?
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.
19 years of data, the converter handles the variability