Skip to content
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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

jufemaiz
Copy link
Member

No description provided.

bje- and others added 30 commits April 8, 2019 11:40
  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).
  Simplify chained comparison between the operands.
  the Python built-in max() function. We can use the _p suffix to
  indicate predicate variables.
* 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
Copy link
Member Author

@jufemaiz jufemaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bje- and @aliebman are you able to comment at all?

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
Copy link
Member Author

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
Copy link
Member Author

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)
Copy link
Member Author

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={
Copy link
Member Author

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
Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants