-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add substitutions to rewriters #238
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
Merged
Merged
Changes from all commits
Commits
Show all changes
263 commits
Select commit
Hold shift + click to select a range
473ffd8
chore: Updated tutorials with Compilation Flags
Brendan-Reid1991 b7753c1
refactor: creating analysis submodule.
Brendan-Reid1991 8ee76d7
feat: Began work on sympy manipulator
Brendan-Reid1991 9c4665f
feat: added instruction types enum; adding functionality to SM
Brendan-Reid1991 84c8dfa
refactor: split base class + sympyManipulator into separate modules
Brendan-Reid1991 b6e14c7
chore: removed generic types
Brendan-Reid1991 415d2cf
refactor: Moved InstructionsType enum
Brendan-Reid1991 af32cbf
feat: Added `focus` method. Generic types added
Brendan-Reid1991 2bf8f30
refactor: Renamed SympyManipulation -> SympyManipulator
Brendan-Reid1991 efea576
fix: removed testing code
Brendan-Reid1991 b5dcdf4
refactor: renamed analysis.py -> optimization.py
Brendan-Reid1991 3f8f32a
refactor: created analysis module
Brendan-Reid1991 b98cf54
feat: created rewriters module
Brendan-Reid1991 03427b5
feat: added expressionwriter abc
Brendan-Reid1991 e0dd510
feat: subclassed from expressionwriter
Brendan-Reid1991 350d422
chore: improving typing
Brendan-Reid1991 c62ec31
feat: Added basic tests for rewriters
Brendan-Reid1991 176b25d
chore: improved typing, added docstrings
Brendan-Reid1991 122a23c
feat: improved typing; added docstrings
Brendan-Reid1991 ce196c2
chore: ran isort
Brendan-Reid1991 2b525c0
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 e071b86
chore: fixed typing issues
Brendan-Reid1991 e4fba55
chore: added module level docstrings
Brendan-Reid1991 2bb75cd
chore: removed unused import
Brendan-Reid1991 41ab585
chore: erroneous line introduced
Brendan-Reid1991 1b270ab
chore: added module level docstring
Brendan-Reid1991 6b3f738
chore: improved typing in update_expression
Brendan-Reid1991 26de84c
chore: added module level docstring; removed return section of docstr…
Brendan-Reid1991 29bc2ca
chore: Type -> type
Brendan-Reid1991 e2e43f3
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 25d4f8e
chore: made expression_rewriter.py public
Brendan-Reid1991 08b64f2
refactor: renamed variables -> free_symbols
Brendan-Reid1991 b483165
refactor: improved docstrings
Brendan-Reid1991 ff2282a
chore: correcting imports
Brendan-Reid1991 fa3e350
refactor: renamed test_variables, and improved it such that it will w…
Brendan-Reid1991 bd41a40
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 2c51d22
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 6dfddb8
chore: added copyright message
Brendan-Reid1991 1a656b5
refactor: renamed free_symbols_in -> free_symbols
Brendan-Reid1991 5310bea
chore: updated docstrings
Brendan-Reid1991 d252149
chore: isort fix
Brendan-Reid1991 2fddca3
docs: improve the API docs (#209)
AVDiv 9f0c5a5
feat: began development on assumptions
Brendan-Reid1991 58eb2b7
chore: Added a comment about allow_transitive_resources to tutorial #1
Brendan-Reid1991 442e6ab
chore: added allow_transitive_resources=False; added quotes to Note a…
Brendan-Reid1991 cb1f7b5
chore: updated tutorial 3
Brendan-Reid1991 d64f9aa
chore: Added sentences about transitive compilation of resources
Brendan-Reid1991 30c8c25
refactor: Created `CompilationFlags` enum
Brendan-Reid1991 9fff558
refactor: Replaced asserts with Exceptions; added fix for repetitions…
Brendan-Reid1991 82df742
chore: Updated docstrings
Brendan-Reid1991 7b49072
chore: updating tests for CompilationFlags
Brendan-Reid1991 59a8718
chore: Modified tests to catch edge case errors (previously assertions)
Brendan-Reid1991 144e1a5
chore: Updated tutorials with Compilation Flags
Brendan-Reid1991 62e3eb0
refactor: creating analysis submodule.
Brendan-Reid1991 c77953d
docs: improve the API docs (#209)
AVDiv 8263d94
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 4cedabc
chore: resolving conflicts
Brendan-Reid1991 3c24a45
chore: free_symbols_in -> free_symbols
Brendan-Reid1991 5fb2e57
chore: free_symbols_in -> free_symbols
Brendan-Reid1991 48b22c3
Resolving conflicts
Brendan-Reid1991 efac47f
Merge branch 'main' into assumptions
Brendan-Reid1991 470701d
Improving assumptions handling
Brendan-Reid1991 b9ec5fc
Merge branch 'main' into assumptions
Brendan-Reid1991 691574c
began typing fixes
Brendan-Reid1991 3c7650c
Removed expression getter/setter. Updated typing
Brendan-Reid1991 e4e1d6c
Removed commented out code
Brendan-Reid1991 fe2dd73
feat: added treemap visualisation class (#216)
antalszava 59289f5
chore: rename nlz to ntz (#225)
pqvr 55b1278
Removed reference to ._expr
Brendan-Reid1991 a2a040f
improved typing
Brendan-Reid1991 e4d44cb
Modifying Basic -> Expr as generic type.
Brendan-Reid1991 81c553e
Modified fixture
Brendan-Reid1991 9e8a6d6
improved typing
Brendan-Reid1991 2285c16
Moved expand test to be sympy specific
Brendan-Reid1991 0335814
changed fixture scope from 'class' to 'function'
Brendan-Reid1991 8d605a5
renamed as_individual_terms - > individual_terms
Brendan-Reid1991 8ee9350
Renamed property; ran isort
Brendan-Reid1991 914159b
renamed as_individual_terms -> individual_terms
Brendan-Reid1991 909098f
typo fix
Brendan-Reid1991 f1ebb16
Removed fixtures from tests and restructured them
Brendan-Reid1991 30e5bd0
chore: update poetry.lock file for dependabot (#227)
pqvr 6520758
refactor: made pandas and plotly optional installs (#226)
Brendan-Reid1991 76f782d
updated substitute function to account for symbols with assumptions o…
Brendan-Reid1991 db15bc0
attempting to consolidate the typing
Brendan-Reid1991 d04e708
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 b0dac31
Added sequence of commands as a test
Brendan-Reid1991 b684323
removing unused import
Brendan-Reid1991 b5f3b7d
Merge branch 'symbolic_manipulator' into assumptions
Brendan-Reid1991 729a982
Updating typing
Brendan-Reid1991 72278d4
Implementing Konrads changes
Brendan-Reid1991 ddf7beb
remove trailing whitespace
Brendan-Reid1991 df3c3ec
added return statement
Brendan-Reid1991 53ad6cf
reimplementing lost changes
Brendan-Reid1991 155406a
Merge branch 'symbolic_manipulator' into assumptions
Brendan-Reid1991 5b3ac52
Implementing SympyAssumption
Brendan-Reid1991 dbfaed9
made it so child classes of ExpressionRewriters do not need the decor…
Brendan-Reid1991 5682efa
moved evaluation check into Assumptions _post_init_
Brendan-Reid1991 962ce34
started assumptions tracking
Brendan-Reid1991 e4107a6
quick fix for custom max problem
Brendan-Reid1991 8d2dae3
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 c56f540
improved docstrings and added comments
Brendan-Reid1991 9db41fb
added reapply_all_assumptions
Brendan-Reid1991 3291d60
formatting
Brendan-Reid1991 6cb0cf3
improving properties dict
Brendan-Reid1991 00eca05
isort
Brendan-Reid1991 3b1b0c3
formatting
Brendan-Reid1991 a9aa3db
began tests
Brendan-Reid1991 340d32d
updated properties dict
Brendan-Reid1991 e3398da
added tests
Brendan-Reid1991 cd8aa32
formatting
Brendan-Reid1991 de923a0
added comment on _add_assumption
Brendan-Reid1991 0b97e37
deleted test file
Brendan-Reid1991 7f03cf5
fixing mypy issues
Brendan-Reid1991 e630f00
fixing mypy issues
Brendan-Reid1991 d52be33
fixing import for py3.10
Brendan-Reid1991 5fd75ca
isort
Brendan-Reid1991 347d853
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 bbb7d81
Merge branch 'symbolic_manipulator' into assumptions
Brendan-Reid1991 4033f07
minor typo fix
Brendan-Reid1991 ca10e9a
Added substitution methods
Brendan-Reid1991 0a081ed
implemented sympy substitutions,including wildcards
Brendan-Reid1991 c0769e9
modified substitute to allow arbitrary substitutions"
Brendan-Reid1991 fc35a33
Merge branch 'main' into substitutions
Brendan-Reid1991 147989a
improvements to wildcard subs
Brendan-Reid1991 8d75e57
Merge branch 'main' into symbolic_manipulator
Brendan-Reid1991 5c3a4a3
erge branch 'symbolic_manipulator' into assumptions
Brendan-Reid1991 ce68e6e
Merge branch 'assumptions' into substitutions
Brendan-Reid1991 884a45b
fixed final bug in wildcard subs
Brendan-Reid1991 a8ba8d9
added hash to assumptions
Brendan-Reid1991 b180073
Merge branch 'assumptions' into substitutions
Brendan-Reid1991 b912f6d
minor refactor
Brendan-Reid1991 ec7cfa3
added decorator to override custom max
Brendan-Reid1991 f17a79c
minor refactor after removing custom max
Brendan-Reid1991 4effe74
began improving tests
Brendan-Reid1991 1c6d628
merge main
Brendan-Reid1991 23b7cab
added classmethod to sympy_backend
Brendan-Reid1991 41dd129
added classmethod to sympy_backend
Brendan-Reid1991 f102207
added tests for .with_sympy_max
Brendan-Reid1991 bd01265
merging in classmethod
Brendan-Reid1991 78d6560
rename Relationals -> Comparators
Brendan-Reid1991 b9a6431
rename relationship->comparator
Brendan-Reid1991 cdc5efe
minor typo fix
Brendan-Reid1991 832310b
re-adding assumptions after mistaken deletion
Brendan-Reid1991 f54691c
changed from using float to literal_eval
Brendan-Reid1991 37e35cd
added more tests for assumptions
Brendan-Reid1991 61040f3
minor fixes
Brendan-Reid1991 278db6e
merge main
Brendan-Reid1991 fa622a7
merge assumptions
Brendan-Reid1991 17688f5
mypy fixes
Brendan-Reid1991 e17ce27
docstring updates;mypy fixes;wildcard improvements
Brendan-Reid1991 a7d2528
mypy fixes
Brendan-Reid1991 12a7cef
improved typehinting
Brendan-Reid1991 f1a8d36
improved tracking of assumptions
Brendan-Reid1991 09a05ca
improved tracking of assumptions
Brendan-Reid1991 20f9145
Merge branch 'main' into modify_sympy_backend
Brendan-Reid1991 b56c043
Merge branch 'modify_sympy_backend' into assumptions
Brendan-Reid1991 6d867d6
merging base
Brendan-Reid1991 44cbd16
updating evaluate from main
Brendan-Reid1991 56d199d
minor fixes
Brendan-Reid1991 eaebc77
gave _substitute default behaviour
Brendan-Reid1991 9a7ddd2
streamlined dataclass interactions
Brendan-Reid1991 2b2e060
deleting test file
Brendan-Reid1991 3624d9a
Merge branch 'modify_sympy_backend' into assumptions
Brendan-Reid1991 133cac4
added_named_tuple
Brendan-Reid1991 87be2a2
bug fixes
Brendan-Reid1991 399a087
change from all caps to snake case
Brendan-Reid1991 a4ed683
minor refactor
Brendan-Reid1991 33b5200
started testing substitutions
Brendan-Reid1991 f88fda5
moving some assumptions tests into basic tests
Brendan-Reid1991 ef5d8bd
merging assumptions
Brendan-Reid1991 82dd1da
updated focus + substitution logic
Brendan-Reid1991 c478c91
added tests
Brendan-Reid1991 692a92f
fixing docstring inconsistencies
Brendan-Reid1991 131e394
quick fixes from michals review
Brendan-Reid1991 65ca4ac
Removed classmethod; moved logic to `parse_to_sympy`
Brendan-Reid1991 ed0943c
modified interpreter to override certain functions
Brendan-Reid1991 4bd96c6
modified rewriter backend def
Brendan-Reid1991 6262d91
removed test until we settle on impl
Brendan-Reid1991 4c73640
bug fixes, test fixes
Brendan-Reid1991 d61c765
deleted unwanted file
Brendan-Reid1991 2d5d3ee
mypy fix
Brendan-Reid1991 84abb66
minor change
Brendan-Reid1991 a153198
refactor
Brendan-Reid1991 cb3e08e
added function_overrides to sympyinterpreter
Brendan-Reid1991 4c07c13
updated sympybackend with new properties
Brendan-Reid1991 8c378d8
updated rewriter after changes to sympy backend
Brendan-Reid1991 b34e00f
modified backend after changes to interpreter
Brendan-Reid1991 6abf5ca
removing unnecessary kwargs
Brendan-Reid1991 a94ad28
improved docstrings
Brendan-Reid1991 7c0daaf
added tests for sympy_backend when using sympy max
Brendan-Reid1991 39807b8
merge parent
Brendan-Reid1991 0360091
rename assume->assumption
Brendan-Reid1991 bb4e65b
fix typing error
Brendan-Reid1991 537816e
test renaming
Brendan-Reid1991 347f3a3
merging assumptions
Brendan-Reid1991 8355d2e
typing fixes
Brendan-Reid1991 6ccb480
merging
Brendan-Reid1991 9eae4c8
refactored into dataclasses
Brendan-Reid1991 853389f
removing tests from downstream branch
Brendan-Reid1991 0c13560
merge main
Brendan-Reid1991 e977335
Merge branch 'assumptions' into refactor_rewriters
Brendan-Reid1991 0bb2788
added instruction set
Brendan-Reid1991 14cf860
renaming assumption->assume
Brendan-Reid1991 a929095
typo
Brendan-Reid1991 91eaffd
another typo
Brendan-Reid1991 2bd4142
renamed kwarg to assumption
Brendan-Reid1991 aa7c852
Merge assumptions
Brendan-Reid1991 43fe406
fixing typing & usability
Brendan-Reid1991 a9a66f1
updated tests to pass
Brendan-Reid1991 7e20e83
merge in main
Brendan-Reid1991 8b45883
fixing imports
Brendan-Reid1991 762edac
deleted erroneous line
Brendan-Reid1991 6181bd9
added tests for history tracking
Brendan-Reid1991 ff170a2
refactoring
Brendan-Reid1991 1b357d0
fixing mypy issues
Brendan-Reid1991 bbb5760
fixing merge conflicts
Brendan-Reid1991 705d99a
refactored instructions
Brendan-Reid1991 c6ccbef
refactored assumptions as child of dummy class
Brendan-Reid1991 983e8ea
modified tests after refactor
Brendan-Reid1991 5e4a49d
made rewriters public
Brendan-Reid1991 348d554
made rewriters public
Brendan-Reid1991 c717452
deleting files
Brendan-Reid1991 f9a602b
exposed rewriter factory
Brendan-Reid1991 9e96857
modified how substitutions are added
Brendan-Reid1991 07b9d7c
minor refactor on substitutions; added factory method
Brendan-Reid1991 dfb5b74
improved logic on linked parameters
Brendan-Reid1991 f458815
updated tests after refactor
Brendan-Reid1991 6883106
added new ignore code to flake8
Brendan-Reid1991 c057ea3
remove unnecessary guards
Brendan-Reid1991 cef9fd5
improving docstrings
Brendan-Reid1991 e0c7a35
improving tests
Brendan-Reid1991 53c966c
tighting typing
Brendan-Reid1991 3589be9
added tests for linked parameters in focus
Brendan-Reid1991 14fe72c
added per-file ignore code for lambdas
Brendan-Reid1991 049a4d3
made wild chars stored in tuples rather than list
Brendan-Reid1991 8e1419c
removed None type from original_expression
Brendan-Reid1991 a8b22fd
removed noqa
Brendan-Reid1991 f55e1f9
simplified logic after Konrads comments
Brendan-Reid1991 38f50dd
minor typing typo (typ-o)
Brendan-Reid1991 aa63931
fixing typos in docstring
Brendan-Reid1991 5ab93c9
updating docstrings
Brendan-Reid1991 470690c
minor factor on substitutions
Brendan-Reid1991 a2a3d83
updating tests
Brendan-Reid1991 35d078a
fixing attr error
Brendan-Reid1991 1728085
fixing tests
Brendan-Reid1991 3a917b5
removed testig code
Brendan-Reid1991 a1b1f09
Merge branch 'main' into substitutions
Brendan-Reid1991 09c9bee
updated assumption properties derivation; improved docstrings
Brendan-Reid1991 418f453
updated tests
Brendan-Reid1991 9d5ea9b
missing word in docstring
Brendan-Reid1991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Given that this only affects
expression_rewriter.py, I suggest moving this ignore to per-file-ignores section.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one other use of this in
sympy_backend(link). I created that protocol during the refactor of the sympy backend, when we added arguments to the parser that broke some of the typing and this was the fix I found.But, I am adding a per-file-ignore for the lambda functions in
_wildcard_substitutions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be better to do it in a particular place where it occurs or just put a noqa in that specific file, rather than here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy either way, I only updated this file because I thought having
noqa: <>in multiple different places looked a bit messy.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting noqa in specific file would not work (or maybe I was doing something wrong), so I think we are down to either local noqas or this per-file-ignores in the config. I think per-file-ignores makes sense in this particular case, because TBH how this rule is implemented is messed up. There is no way to exclude ellipsis on the same line (which is a common formatting practice for protocol methods), and ignoring each one of those separately seems messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good to me!