Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for .is_<substate>() for HSM with nonstandard separator? #500

Closed
alterscape opened this issue Jan 21, 2021 · 2 comments
Closed

Example for .is_<substate>() for HSM with nonstandard separator? #500

alterscape opened this issue Jan 21, 2021 · 2 comments

Comments

@alterscape
Copy link

First of all, thank you for this library.

It isn't clear to me how the auto-generated model.is_<state>() methods for HSM substates are named in the case of non-standard separator characters. I am using a non-standard separator, -, because I'm working in a code base where snake_case is strongly desired for all methods. However, I think this is breaking the generation of is_ methods, because is_superstate_name-substate_name is, of course, not a legal Python identifier.

I could use camel case or some other scheme, but I'd strongly prefer not to...

@aleneum
Copy link
Member

aleneum commented Jan 22, 2021

The current version (0.8.6) of transitions only supports root state checks (with allow_substates) and the generic model.state == C_2_a approach.
In f3c8ce8 I added support for FunctionWrappers for state check. Previously, they had only been used for auto transitions. I documented this feature in the HSM section of the README. Let me know if that is what you were looking for.

@aleneum
Copy link
Member

aleneum commented Feb 4, 2021

I am closing this since there has not been feedback in about 14 days. If your issue persists, feel free to comment anyway and I will reopen the issue if necessary.

@aleneum aleneum closed this as completed Feb 4, 2021
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

No branches or pull requests

2 participants