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

WIP - do not merge - MACRO py test #152

Closed
wants to merge 5 commits into from

Conversation

ClaraLuisa
Copy link
Contributor

No description provided.

message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro.py Show resolved Hide resolved
message_ix/macro.py Show resolved Hide resolved
message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro.py Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

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

a first round of comments

message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro_utils.py Outdated Show resolved Hide resolved
# running MACRO standalone
if not new.has_set("node"):
new.init_set("node")
for node in dict['region_list']:
Copy link
Member

Choose a reason for hiding this comment

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

I would think that all elements of region_list must be in node, so this can be removed.

However, it would be nice to have macro_regions as an optional argument, defaulting to 'all regions except World if None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how this "running MACRO standalone" thing is supposed to work so I am not sure what the impact of removing this would be. Should I still simply remove it?

I now introduced a kwarg macro_regions and changed the code to:

Suggested change
for node in dict['region_list']:
for node in macro_regions:
new.add_set("node", node)

Copy link
Member

Choose a reason for hiding this comment

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

@behnam2015 says he never needed that to get started, so let’s remove this feature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danielhuppmann, you suggest we delete all regular "MESSAGE sets" (i.e.: node, cat_node, year, cat_year and commodity ) from the MACRO_SPECS['sets']?

message_ix/macro_utils.py Outdated Show resolved Hide resolved
message_ix/macro.py Outdated Show resolved Hide resolved
# set of MACRO base year
if not new.has_set("type_year"):
new.init_set("type_year")
new.add_set("type_year", "baseyear_macro")
Copy link
Member

Choose a reason for hiding this comment

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

not sure if we still need this for the GAMS code to work

message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro.py Outdated Show resolved Hide resolved
['prfconst', ['node', 'sector', ], ],
['grow', ['node', 'year', ], ],
['aeei', ['node', 'sector', 'year', ], ],
],

Choose a reason for hiding this comment

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

E123 closing bracket does not match indentation of opening bracket's line

['EC', ['node', 'year', ], ],
['grow_calibrate', ['node', 'year', ], ],
['aeei_calibrate', ['node', 'sector', 'year', ], ],
],

Choose a reason for hiding this comment

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

E123 closing bracket does not match indentation of opening bracket's line

],
'equs': [
['COST_ACCOUNTING_NODAL', ['node', 'year', ], ]
],

Choose a reason for hiding this comment

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

E123 closing bracket does not match indentation of opening bracket's line

message_ix/macro.py Show resolved Hide resolved
message_ix/macro.py Outdated Show resolved Hide resolved
message_ix/macro.py Show resolved Hide resolved
["cat_year", ["type_year", "year", ], ],
["commodity", ], ['level', ], ["sector", ],
["mapping_macro_sector",
["sector", "commodity", "level", ], ],

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

["commodity", ], ['level', ], ["sector", ],
["mapping_macro_sector",
["sector", "commodity", "level", ], ],
],

Choose a reason for hiding this comment

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

E126 continuation line over-indented for hanging indent

["mapping_macro_sector",
["sector", "commodity", "level", ], ],
],
'pars': [

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

message_ix/macro.py Show resolved Hide resolved
i0 = k0 * (data['growth'].loc[data['firstmodelyear']] + data['depr'])


# production function coefficients for capital, labor (aconst) and

Choose a reason for hiding this comment

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

E303 too many blank lines (2)

message_ix/macro.py Show resolved Hide resolved

# production function coefficient of capital and labor
for node in data['region_list']:
new.add_par("lakl", aconst.loc[aconst.node==node], "-")

Choose a reason for hiding this comment

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

E225 missing whitespace around operator

@gidden
Copy link
Member

gidden commented Jan 23, 2019

Hi! I recently updated our CI. Could you please rebase this branch on iiasa/master to get the new changes in? Thanks!

@gidden
Copy link
Member

gidden commented Apr 29, 2019

hi folks, I'm trying to do an open PR clean up. what's the status of this one? should it stay open?

@gidden
Copy link
Member

gidden commented Jul 29, 2019

Closing in favor of #223

@gidden gidden closed this Jul 29, 2019
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.

None yet

4 participants