Skip to content

Support inheritance for Statemachine classes - #247

Closed
rschrader wants to merge 1 commit into
fgmacedo:developfrom
rschrader:develop
Closed

rschrader wants to merge 1 commit into
fgmacedo:developfrom
rschrader:develop

Conversation

@rschrader

Copy link
Copy Markdown

When defining states and transitions in a base class, they are not
detected by the sub class. Therefore The StateMachinMetaClass is
extended to also take care of the states and transitions of the base
classes

@rschrader
rschrader force-pushed the develop branch 2 times, most recently from d69ee2f to 6b241f2 Compare October 17, 2019 13:52
@codecov

codecov Bot commented Oct 17, 2019

Copy link
Copy Markdown

Codecov Report

Merging #247 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #247   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files            5      5           
  Lines          308    313    +5     
  Branches        42     45    +3     
======================================
+ Hits           308    313    +5
Impacted Files Coverage Δ
statemachine/statemachine.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 636961d...e13d8e0. Read the comment docs.

@rschrader

Copy link
Copy Markdown
Author

How important is it to reduce the cognitive complexity in this case? I think creating additional functions will complicate the code even more.

@rschrader

Copy link
Copy Markdown
Author

Solves Issue: #211

@fgmacedo

fgmacedo commented Oct 19, 2019

Copy link
Copy Markdown
Owner

Hi @rschrader , thanks for fixing this issue. Could you please add tests to cover this scenario? Also consider adding yourself at AUTHORS.rst/Contributors list.

@rschrader
rschrader force-pushed the develop branch 2 times, most recently from d0879a8 to 6539539 Compare October 19, 2019 12:35
@rschrader

Copy link
Copy Markdown
Author

Sure :)

When defining states and transitions in a base class, they are not
detected by the sub class. Therefore The StateMachinMetaClass is
extended to also take care of the states and transitions of the base
classes

Issue: fgmacedo#211
@rschrader

Copy link
Copy Markdown
Author

I am ready to merge :)

@rschrader

Copy link
Copy Markdown
Author

@fgmacedo : ist there anything missing to merge the pull request? Shall I change anything. Just wondering why it doesn't get merged.

@fgmacedo

fgmacedo commented Jan 23, 2020

Copy link
Copy Markdown
Owner

@rschrader Thanks for your contribution! I've made a few updates since Transition and State instances had knowledge of who are the StateMachine they belongs, but this is now removed.

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