feat: added ExpressionRewriter class and SympyExpressionRewriter subclass#205
feat: added ExpressionRewriter class and SympyExpressionRewriter subclass#205Brendan-Reid1991 merged 107 commits intomainfrom
Conversation
…bout interactive tools
… + transitive resources
* chore: update poetry.lock file for dependabot * chore: update lock file * chore: remove h11 as transient dependency * chore: update poetry lock
* refactor: made pandas and plotly optional installs * Added checks to ensure tests do not fail unexpectedly * ran isort * Added .venv to .gitignore * Addition of pandas stubs changed behaviour of scipy stubs; quick fix * renamed visualization->interactive * updated extras flag * renamed vis->viz * chore: rename nlz to ntz (#225) * chore: rename nlz to ntz * chore: add deprecated class alias. * fix: test and linter * added plotly-stubs; may revert * Removed type: ignore * removed type: ignore; updated error message * fixing plotly-stubs install * Removed plotly-stubs entirely. * added pytest.importorskip to module * Added noqa to pass flake8 * Ran isort * isort versioning mismatch * Streamlined some aspects of the TreeMap class; removed unnecessary checks * Removing unused imports * fix: Fix typing in analysis module --------- Co-authored-by: pqvr <work.vrpq@gmail.com> Co-authored-by: Konrad Jałowiecki <dexter2206@gmail.com>
|
@dexter2206 changing I explored the idea of renaming I then opted for a decidedly worse solution, but one that requires minimal changes to the API: the which just moves that functionality from I expect another round or two of changes, so take a look and let me know! |
Code Coverage SummaryResults for commit: 347d853 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Dismissing review to finalise this PR. Michal communicated that he was satisfied with the state of the PR after our discussions with Konrad.
Description
A proper implementation of the
Gnarly Symbolic ExpressionclassGSEfromgse_prototypingbranch.What this PR does:
ExpressionRewriter. Features implemented in the base class include:focusing on particular variables, such that terms that do not include those variables are obfuscated.ResourceRewriter.ExpressionRewriteron the top level resource, in a future PR this will be amended such that a sequence of instructions can be applied to a routine hierarchy.SympyExpressionRewriteris the genuine inheritor ofGSE. Subclasses fromExpressionRewriterand adds some functionality.list_argument_of_functionandall_functions_and_argumentsare not abstract methods ofExpressionRewriter, but I am happy for these to be made abstract methods.What this PR does not do
Tests
basic_rewriter_tests.pythat contain tests that allrewriters(regardless of backend) should pass.backend.as_expressionmethod, and these can be used by the subclasses.sympyis our only backend. But, in the event we do introduce another symbolic backend this will prevent a major refactor, or test rewriting.Please pay attention to the typing and ensure I have it correct, I spent far too long on it and I'm still not 100% confident with it.
Please verify that you have completed the following steps