Skip to content

Rename ParameterSet required namespace from global to globals - #334

Open
ad-cqc wants to merge 2 commits into
mainfrom
ad-cqc/ps-globals
Open

ad-cqc wants to merge 2 commits into
mainfrom
ad-cqc/ps-globals

Conversation

@ad-cqc

@ad-cqc ad-cqc commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Renames the required top-level ParameterSet namespace global to globals (ps.globals.version, globals: in YAML).

  • REQUIRED_NAMESPACES, docstrings, and docstring examples in src/schematics/parameter_set.jl
  • Tests in test/test_parameter_set.jl
  • Tutorial docs/src/tutorials/parameter_set.md
  • CHANGELOG entry under Unreleased

It's a breaking, as ParameterSet shipped in 1.18.0. Existing YAML files/dicts using global: load without error but leave globals empty, so old PS serializations must rename the key.

Testing

ParameterSet test items pass locally (353/353).

@ad-cqc
ad-cqc requested a review from gpeairs September 25, 2026 18:48
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@parrangoiz

Copy link
Copy Markdown
Contributor

Given that globals is a built-in function in Python this seems like a poor choice as well. Maybe let's switch to a different name altogether?

@ad-cqc

ad-cqc commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

UPD: globals is function name, which is fine to use in dot notation. But using global name ends up with hard Python syntax error.

It's global, thus this change to plural to avoid a clash with a singular Python keyword.

@gpeairs

gpeairs commented Sep 30, 2026

Copy link
Copy Markdown
Member

I suggest sending "global" to the new key in the constructor (parameter_set.jl:52-63, the isempty(prefix) branch) with if haskey(data, "global") && !haskey(data, "globals") → use the new key and @warn … maxlog=1, so that old PS files still work.

I also have a mild preference for "design" if we're changing it (no one has to remember if it's singular or plural).

A parameter file written against the released `global:` spelling used to load
without error but leave `globals` empty, so every shared parameter silently
vanished. Migrate the key in the root constructor instead and warn once.

This branch has not been deployed

No deployments
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