Skip to content

Allow None in simulator's input_state type#458

Open
thierry-martinez wants to merge 1 commit intoTeamGraphix:masterfrom
thierry-martinez:input_state_none
Open

Allow None in simulator's input_state type#458
thierry-martinez wants to merge 1 commit intoTeamGraphix:masterfrom
thierry-martinez:input_state_none

Conversation

@thierry-martinez
Copy link
Collaborator

The run method handles None and doesn't add input nodes to the backend in this case, assuming that the backend has already been prepared by the caller. However, the type annotation prevented using None as an input_state value.

        if input_state is not None:
            self.backend.add_nodes(self.pattern.input_nodes, input_state)

The `run` method handles `None` and doesn't add input nodes to the
backend in this case, assuming that the backend has already been
prepared by the caller. However, the type annotation prevented using
`None` as an `input_state` value.

```python
        if input_state is not None:
            self.backend.add_nodes(self.pattern.input_nodes, input_state)
```
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.29%. Comparing base (b70ffeb) to head (10f399f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #458   +/-   ##
=======================================
  Coverage   88.29%   88.29%           
=======================================
  Files          44       44           
  Lines        6533     6533           
=======================================
  Hits         5768     5768           
  Misses        765      765           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant