Skip to content

Move build_flags from SimDevice to SimData. - #3100

Merged
janiversen merged 2 commits into
pymodbus-dev:devfrom
daveharsh38:refactor/simdata-build-flags
Nov 25, 2026
Merged

janiversen merged 2 commits into
pymodbus-dev:devfrom
daveharsh38:refactor/simdata-build-flags

Conversation

@daveharsh38

Copy link
Copy Markdown
Contributor

SimDevice.__build_flags(simdata) only reads the datatype and readonly fields of the SimData it's given. This PR moves it to SimData.build_flags(), next to the existing SimData.build_registers*() methods that also turn a SimData into its runtime form. SimDevice.__create_simdata() now calls simdata.build_flags().

Behaviour is unchanged. I added a unit test for build_flags(), and check_ci.sh passes with coverage at 100%.

SimDevice.__build_flags(simdata) only read the datatype and readonly
fields of the SimData it was given (feature envy). Move it to
SimData.build_flags(), next to the existing build_registers() methods
that also turn a SimData into its runtime form, and call it from
SimDevice. Add a test for the moved method.

@janiversen janiversen 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.

LGTM, thanks.

@janiversen
janiversen merged commit bdaf29c into pymodbus-dev:dev Nov 25, 2026
16 checks passed
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.

2 participants