Skip to content

Change default variance to None on Parameter (and typing fixed) - #360

Merged
damskii9992 merged 5 commits into
developfrom
default_variance
Nov 5, 2026
Merged

damskii9992 merged 5 commits into
developfrom
default_variance

Conversation

@damskii9992

@damskii9992 damskii9992 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This PR changes the default variance on Parameter to None instead of 0.0, in line with our DescriptorNumber and DescriptorArray. It also fixes our Optional and Union typehinting issue.

@damskii9992 damskii9992 added [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) [priority] low Low importance labels Nov 4, 2026
@damskii9992
damskii9992 requested a review from rozyczko November 4, 2026 12:12
@damskii9992 damskii9992 linked an issue Nov 4, 2026 that may be closed by this pull request
@rozyczko

rozyczko commented Nov 5, 2026

Copy link
Copy Markdown
Member

Removal of Union and Optional in the same PR?? BAD CHRISTIAN, BAD!!

  • parameter.py:160: still uses 0.0 in from_dependency. You didn't update default_kwargs = {'value': 0.0, 'variance': 0.0, ...}. Probably harmless but looks confusing.

  • No test for the new default? Nothing checks that Parameter(1.0).variance is None or .error is None.

  • Typing:
    DescriptorNumber.variance -> float, and .error -> float should be float | None.
    The setters variance_float: float and error(value: float), in both descriptor_number.py and parameter.py, accept None and shouldalso have correct typing.

@rozyczko rozyczko left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As explained above

@damskii9992

Copy link
Copy Markdown
Contributor Author
  • parameter.py:160: still uses 0.0 in from_dependency. You didn't update default_kwargs = {'value': 0.0, 'variance': 0.0, ...}. Probably harmless but looks confusing.

This one is definitely harmless. As it gets overwritten immediately anyways, but I suppose I might as well change it. 🤷

@damskii9992
damskii9992 requested a review from rozyczko November 5, 2026 13:39

@rozyczko rozyczko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good now 👌
Still fuming about the drive-by removal of Optional but we need this be consistent in the code.

@damskii9992
damskii9992 merged commit 03d807d into develop Nov 5, 2026
33 checks passed
@damskii9992
damskii9992 deleted the default_variance branch November 5, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] low Low importance [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Optional and replace with vbar

2 participants