Skip to content

consistent typing for lists, continued - #458

Merged
wpbonelli merged 1 commit into
modflowpy:developfrom
wpbonelli:prp-words
Oct 13, 2026
Merged

wpbonelli merged 1 commit into
modflowpy:developfrom
wpbonelli:prp-words

Conversation

@wpbonelli

Copy link
Copy Markdown
Member

Follow-up to #457. The OC reshape missed PRP which has the same form

# before
Prp(stress_period_data={0: [Prp.All(), Prp.Frequency(2)]})
# after
Prp(stress_period_data={0: ["ALL", Prp.Frequency(2)]})

…through dataframes

PRP's ALL, FIRST and LAST were classes (Prp.All, ...) while OC's
ocsetting takes the same words as strings. A list of unions' keyword arms
are now words too: PRP's period element is
Literal['ALL', 'FIRST', 'LAST'] | Frequency | Steps | Fraction. Rows read,
write and coerce as a union field's value does, and a row no arm takes
raises rather than being dropped.

to_dataframe kept a union field's arm (MAW's mawsetting) as a dict, which
from_dataframe couldn't read back; it keeps the instance now. A list of
unions' frame names each row's arm, or is its word, in a keyword column,
so from_dataframe takes it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli wpbonelli added this to the MVP milestone Oct 13, 2026
@wpbonelli
wpbonelli marked this pull request as ready for review October 13, 2026 01:38
@wpbonelli
wpbonelli merged commit 833753b into modflowpy:develop Oct 13, 2026
17 checks passed
@wpbonelli
wpbonelli deleted the prp-words branch October 13, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant