Skip to content

Add defaults and checking for per_cell and per_tile#10

Open
Whyborn wants to merge 2 commits into
mainfrom
add-defaults-to-LUC-script
Open

Add defaults and checking for per_cell and per_tile#10
Whyborn wants to merge 2 commits into
mainfrom
add-defaults-to-LUC-script

Conversation

@Whyborn

@Whyborn Whyborn commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The restart adjustment script would fail if the user decided to remove either the per_cell or per_tile entries in the config, which are valid choices to make. This adds handling for that case, and ensures that the values supplied for this entry are iterable as expected by the rest of the script.

@NortonAlex is currently testing this.

Whyborn and others added 2 commits July 2, 2026 12:05
This change ensures that the per_cell and per_tile fields in MappingConf do not end up with `None` values if the config file has no listed items under per_cell or per_tile.
@Whyborn

Whyborn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Alex's commit makes it behaves as expected if the per_cell or per_tile entries are provided in the config, but not given any values. I thought using the get form without a default would raise an error, but apparently it returns None, as opposed to the dict['<key>'] notation which does raise an error if the key doesn't exist.

@Whyborn Whyborn requested a review from blimlim July 3, 2026 02:01

@blimlim blimlim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Whyborn, looks good to me

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.

3 participants