message_ix icon indicating copy to clipboard operation
message_ix copied to clipboard

Adapt a common `make_df()` style in Westeros tutorials

Open LauWien opened this issue 3 years ago • 0 comments

In PR https://github.com/iiasa/message_ix/pull/524 @khaeru mentioned, that a common style of creating dataframes could be introduced for further improvements.

In some cases like here, black was applied but the underlying code idiom was left as-is. The code works and it's fine to merge, but I think a later PR could improve these further to suggest a common style, e.g.:

name = "soft_activity_up"
scen.add_par(
    name,
    make_df(
        name,
        node_loc=country,
        technology="wind_ppl",
        year_act=model_horizon,
        time="year",
        value=[0, 0, 0, 0.01],
        unit="-",
    )
)

or

name = "soft_activity_up"
data = make_df(
    name,
    node_loc=country,
    technology="wind_ppl",
    year_act=model_horizon,
    time="year",
    value=[0, 0, 0, 0.01],
    unit="-",
)
scen.add_par(name, data)

LauWien avatar Apr 28 '22 09:04 LauWien