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

automat: the next generation #137

Merged
merged 233 commits into from
Aug 17, 2024
Merged

automat: the next generation #137

merged 233 commits into from
Aug 17, 2024

Conversation

glyph
Copy link
Owner

@glyph glyph commented Mar 16, 2022

Fixes #145

obviously needs tests and perhaps some more thought (in particular… how would feedback state-changes work here?) but I think this might be cleaner than the methodical machine

Stuff to do before landing:

  • full test coverage
  • examine .to/.upon ordering for better type errors
  • visualization cleanups: outputs need much shorter, pithier names that look good in a visualization (inputs and states are OK)
  • deserialization: it needs to be possible to instantiate a type machine in a particular state, with a particular state-specific data if it's a data state. (the serialization half can be done with a regular input)
  • documentation: all the documentation needs to be rewritten to use TypeMachineBuilder
  • internal naming: _typified is a bit of a silly name, renaming to something like _typed would be better.
  • typing: possibly TypeMachine needs to be public so that people who want to call .asDigraph (or whatever the tracing or serialization APIs are) can still annotate their return types
  • additional safety:
    • any mutation to the type builder (builder.state, state.upon, upon.to etc) must raise an exception if .build has already been called
    • all methods should be checked for membership in their protocol, to ensure that free functions are not used that create conflicts
  • style: make up my mind on snake_case vs. camelCase

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2022

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (2da0af1) 91.82% compared to head (9466e8f) 94.18%.

Files Patch % Lines
automat/_typical.py 99.19% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk     #137      +/-   ##
==========================================
+ Coverage   91.82%   94.18%   +2.36%     
==========================================
  Files          11       13       +2     
  Lines        1260     1806     +546     
==========================================
+ Hits         1157     1701     +544     
- Misses        103      105       +2     

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

This commit was sponsored by Matt Campbell, hacklschorsch, Jason
Walker, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
…'postponed' check

This commit was sponsored by Steven S., Devin Prater, Jason Walker,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by Jason Walker, Devin Prater, Jason Mills,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by Jason Mills, hacklschorsch, Derek Veit,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by Devin Prater, Sergio Bost, Steven S., and
my other patrons.  If you want to join them, you can support my work
at https://glyph.im/patrons/.
This commit was sponsored by Derek Veit, Jason Mills, Devin Prater,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by hacklschorsch, Matt Campbell, Steven S.,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by hacklschorsch, Matt Campbell, Devin
Prater, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, Devin Prater,
hacklschorsch, and my other patrons.  If you want to join them, you
can support my work at https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, hacklschorsch, Devin
Prater, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, hacklschorsch, and my
other patrons.  If you want to join them, you can support my work at
https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, hacklschorsch, and my
other patrons.  If you want to join them, you can support my work at
https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, and my other patrons.  If
you want to join them, you can support my work at
https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, and my other patrons.  If
you want to join them, you can support my work at
https://glyph.im/patrons/.
This commit was sponsored by Steven S., Jason Walker, Thomas
Ballinger, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
This commit was sponsored by Jason Mills, AJ Collins, Steven S., and
my other patrons.  If you want to join them, you can support my work
at https://glyph.im/patrons/.
This commit was sponsored by hacklschorsch, Steven S., Matt Campbell,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by Jason Mills, Mahmoud Hashemi, Samuel
Coleman, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
This commit was sponsored by Holly B, jhulten, Al Sweigart, and my
other patrons.  If you want to join them, you can support my work at
https://glyph.im/patrons/.
This commit was sponsored by James C Abel, Jason Walker,
hacklschorsch, and my other patrons.  If you want to join them, you
can support my work at https://glyph.im/patrons/.
This commit was sponsored by hacklschorsch, Matt Campbell, Sergio
Bost, and my other patrons.  If you want to join them, you can support
my work at https://glyph.im/patrons/.
This commit was sponsored by Jason Walker, Christopher Neugebauer,
tgs, and my other patrons.  If you want to join them, you can support
my work at https://glyph.im/patrons/.
This commit was sponsored by Jason Walker, Derek Veit, Devin Prater,
and my other patrons.  If you want to join them, you can support my
work at https://glyph.im/patrons/.
This commit was sponsored by Matt Campbell, hacklschorsch, Jason
Mills, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
This commit was sponsored by rockstar, Sergio Bost, Sean
Reifschneider, and my other patrons.  If you want to join them, you
can support my work at https://glyph.im/patrons/.
@glyph glyph changed the title sketch of new type-annotation-based interface automat: the next generation Aug 17, 2024
@glyph glyph merged commit 3a417a4 into trunk Aug 17, 2024
11 checks passed
@glyph glyph deleted the typical branch August 17, 2024 20:34
This was referenced Aug 19, 2024
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.

automat2: type-hints based API with a separate class per state
2 participants