-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update from @aliebman #1
base: master
Are you sure you want to change the base?
Conversation
prints the exception and exits with status 1, it might be better to not catch these exception and let Python print the traceback and exit (it also exits with status 1).
flake8 fixes
<lambda>] Lambda may not be necessary.
valid_file] Unused variable 'base'.
Simplify chained comparison between the operands.
[] as argument. See http://pylint-messages.wikidot.com/messages:w0102 for details.
value [] as argument. See http://pylint-messages.wikidot.com/messages:w0102 for details.
<lambda>] Lambda may not be necessary.
the Python built-in input() function.
the Python built-in max() function. We can use the _p suffix to indicate predicate variables.
Unnecessary "else" after "return".
plotcluster] Unused variable 'f'.
* cemo/multi.py: Silence the following Pylint warnings: R1719(simplifiable-if-expression), SolveTemplate.__init__] The if expression can be replaced with 'test'
No need to loop over the file contents. Just read() the file.
Eliminate various Pylint warnings
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.
maxsynth=False): | ||
self.firstdow = firstdow # Day of week starting period | ||
self.lastdow = lastdow # Day of week ending period` | ||
self.max_d = max_d # Maximum number of clusters | ||
self.regions = regions # NEM region tuple | ||
self.regions = range(1, 6) if regions is None else regions # NEM region tuple |
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.
Supports a default versus all.
Should this be range(1, 6) @aliebman to advise?
@@ -13,6 +13,7 @@ | |||
|
|||
|
|||
def init_year_correction_factor(model): | |||
#pylint: disable=unused-argument |
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.
Wait, what argument is being ignored? o.O
@@ -138,10 +138,10 @@ def jsonify(inst): | |||
|
|||
def jsoninit(inst): | |||
'''Produce JSON output sufficient to initialise a cemo model''' | |||
input = jsonify(inst) | |||
inp = jsonify(inst) |
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.
why truncate?
@@ -496,7 +496,12 @@ def produce_exogenous_capacity(self, year): | |||
exogenous_capacity += '#Exogenous capacity entry ' + key + '\n' | |||
exogenous_capacity += 'param ' + key + ':=\n' | |||
exogenous_capacity += cap[['zone', 'tech', 'value'] | |||
].to_string(header=False, index=False) | |||
].to_string(header=False, index=False, | |||
formatters={ |
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.
Can we make the formatter a constant?
@@ -281,11 +281,11 @@ def printstats(instance): | |||
print("End of results for %s" % instance.name, flush=True) | |||
|
|||
|
|||
def plotcluster(cluster, row=3, col=4, ylim=[5500, 16000]): # pragma: no cover | |||
def plotcluster(cluster, row=3, col=4, ylim=None): # pragma: no cover |
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.
Perhaps use a more common default value method?
Also, what is 5500 and 16000?
No description provided.