Transformer interface and behavior change in 0.6.0
See original GitHub issueHi !
I was wondering: why did the interface for Transformer
methods change ?
I used to have:
class MyTransformer(Transformer_NoRecuse):
def some_rule(self, tree: Tree):
tree.children = [...] # Some changes on children + access to tree class
return tree
Now, when converting to Transformer_InPlace)
, I’m bothered by the fact that a function rule will delete the tree. e.g.
class MyTransformer(Transformer_InPlace):
def some_rule(self, values: List):
values = [...] # Some changes on values + no access to tree class :(
return values # <- In the final tree, the `some_rule` node has disappeared !
I can update my code to the new Transformer_InPlace
with many changes but having access to the tree and a way to rewrite portions and/or delete the tree element gave more flexibility in the usage. What is the rationale behind removing tree
s in arguments to transformer functions ? Is there a way to have access to the tree
in each transformer functions ?
Thanks for the wonderful work you’re doing on lark 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Installation Error - Failed building wheel for tokenizers #2831
Before running the installation edit transformers/setup.py and change requirement of tokenizers to 0.6.0. Line 93: install_requires=[
Read more >We released a new version of ShapeShift (0.6.0) - Reddit
We released a new version of ShapeShift (0.6.0) - A lightweight, modular, performant and extensible object mapping library.
Read more >Changelog — sktime documentation
This will change how classification safety decisions are made and returned, see BaseEarlyClassifier or TEASER for the new interface.
Read more >deepsparse Changelog - pyup.io
Changes : * The behavior of the Multi-stream scheduler is now identical to the Elastic scheduler, and the old Multi-stream scheduler has been...
Read more >Joris Van den Bossche: Home
Short summary: the upcoming 0.6.0 release of GeoPandas will feature a refactor based on the pandas ExtensionArray interface. Although this change should keep ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, having looked at both, I think MkDocs is probably better for Lark, because
It uses Markdown, which is simpler, and it’s what the existing documentation uses
It has nicer default themes
I’ve used Sphinx in the past and it was straightforward to set up and use.
There’s good documentation here: http://dont-be-afraid-to-commit.readthedocs.io/en/latest/documentation.html
Would you want me to suggest a pull-request for this ?