-
Notifications
You must be signed in to change notification settings - Fork 41
Allowing substituted, unitless signomials in exponents. #1438
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
Open
1ozturkbe
wants to merge
26
commits into
master
Choose a base branch
from
varexp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7817d07
Adding a couple of test scripts.
1ozturkbe ef85a4c
basics to allow x**x
bqpd cd00eb8
Merge branch 'master' into varexp
1ozturkbe 5daf1bb
Removing junk files from Riley and I, oops.
1ozturkbe d3eeadb
Now checking exponent units.
1ozturkbe fcdeb2e
Beginnings of testing, sig exp printing (darn python strings, not wor…
1ozturkbe 8f4fd1f
Moving varexps check to NomialMap (better for subs).
1ozturkbe 780a1ea
Merge branch 'master' into varexp
1ozturkbe fa7a4c1
repr_conventions checks exponent type.
1ozturkbe 2ddc58e
Hmaps work as intended. Small victories!
1ozturkbe 45aa4d1
Make sure we aren't losing varkeys in varexps.
1ozturkbe fc3ea67
Pint.
1ozturkbe e6dcc0f
Checking for units in signomial exps.
1ozturkbe df50903
repr_conventions varexp printing fix.
1ozturkbe 47ea4b7
Updating vks instead of varkeys, lint.
1ozturkbe 106a6df
Replace str_without with try_str_without.
1ozturkbe f136df2
Merge branch 'master' into varexp
1ozturkbe afa8d3d
genA works, but now sens_from_dual issues.
1ozturkbe 6843322
Sens_from_dual should work.
1ozturkbe 7451cc1
Boundedness checking for inequalities.
1ozturkbe 3e65e84
Fixing non-subscriptable keys.
1ozturkbe c173a4d
Iterables in py3 are a pain in the backside.
1ozturkbe 7a19d36
Push partial fixes to bounding.
1ozturkbe 2349677
Merge branch 'master' into varexp
1ozturkbe cb2a9d6
Fixed bounded bug (wrong logic for meq_idxs).
1ozturkbe eb44a7e
lint
1ozturkbe 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 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 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 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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,17 +192,17 @@ def __neg__(self): | |
|
|
||
| def __pow__(self, other): | ||
| "Accepts scalars. Return Hashvector with each value put to a power." | ||
| if isinstance(other, Numbers): | ||
| return self.__class__({key: val**other | ||
| for (key, val) in self.items()}) | ||
| return self.__class__({key: val**other | ||
| for (key, val) in self.items()}) | ||
| return NotImplemented | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fallback return statement is currently unnecessary
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol pylint will catch this though, so I'll stop flagging things I know pylint will catch |
||
|
|
||
| def __mul__(self, other): | ||
| """Accepts scalars and dicts. Returns with each value multiplied. | ||
|
|
||
| If the other object inherits from dict, multiplication is element-wise | ||
| and their key's intersection will form the new keys.""" | ||
| if isinstance(other, Numbers): | ||
| from gpkit.nomials.math import Signomial | ||
| if isinstance(other, Numbers + (Signomial,)): | ||
| return self.__class__({key: val*other | ||
| for (key, val) in self.items()}) | ||
| elif isinstance(other, dict): | ||
|
|
||
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
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.
convention for comments in GPkit is double space between code and
#, no alignmentThere 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 think pylint may complain about one of those or the other?