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

Feature/tutorials #609

Merged
merged 10 commits into from
Jan 6, 2023
Merged

Feature/tutorials #609

merged 10 commits into from
Jan 6, 2023

Conversation

NicolasColombi
Copy link
Collaborator

@NicolasColombi NicolasColombi commented Dec 28, 2022

This PR fixes #

2 typos in 2 tutorials.

  1. climada_engine_CostBenefit.jpynb in the comment before cell 14.
    different --> difference

  2. climada_entity_DiscRates.jpynb in the first paragraph before cell 1.
    const-benefit --> cost-benefit

PR Author Checklist

PR Reviewer Checklist

Fix  2 typos in 2 tutorials.

1) climada_engine_CostBenefit.jpynb in the comment before cell 14.
Different --> Difference

2) climada_entity_DiscRates.jpynb in the first paragraph before cell 1.
const-benefit --> cost-benefit
This commit fix a typo in the first cell of the tutorial
climada_entity_Impact_FuncSet. exposurethe --> exposure
This commit fix a typo in the markdown cell before cell 4 of the
tutorial climada_entity_Impact_FuncSet. forllowing --> following
This commit fix 2 typos in the tutorial climada_entity_Impact_FuncSet.
1) To generate the this --> To generate this
2) ImpactFunctionSet --> `ImpactFuncSet` (just for consistancy
with the other headers in the tutorial)
This commit fix typos in the tutorial
climada_entity_Impact.jpynb

1) Typo 1: To computation -> The computation
2) Typo 2: `Exposures'` -> `Exposures`
3) Typo 3: value the corresponding -> values of the corresponding
Fix bug in the tutorial climada_entity_Impact_FuncSet.

Unfortunately, not all the outputs could be reverted after the changes
were saved. Therefore, a lot of outputs have changed (plots mainly).

The arguments that define an impact function where not
specified with keywords when Impct.Func were called
to initialize an arbitrarly imp_fun, additionaly there where in
a different order in respect to the __init__ function of ImpactFunc.
Therefore, when calling Impact.Func.mdd, Impact.Func.paa and
Impact.Func.intensity, the following wrong outputs were produced.

imp_fun.intensity was instanciated as intensity units
imp_fun.intensity_unit was instanciated as mdd
imp_fun.name  was instanciated as paa
imp_fun.haz_type  was instanciated as id
imp_fun.paa  was instanciated as intesity

Therefore when u_check was called to check that the size of the
intensity is equal to the size of mdd and paa, it was not comparing
the actual real intesities, mdd and paa, but the above values.

By specifyng the arguments as in the next paragraph, u_check,
situtated in: climada/entity/impact_funcs/base.py, compare that
the size of the real intensity is equal to the size of the real mdd
and paa.

Specification of the arguments with keyword:

imp_fun = ImpactFunc(id=id, name=name, intensity_unit=intensity_unit,
 haz_type=haz_type, intensity=intensity, mdd=mdd, paa=paa)
This reverts commit 9ae72a4.

The outputs changed so it was impossible to read just the changes that
I made. A new commit where only the changes that I made are visible
will be made.
Fix bug in the tutorial climada_entity_Impact_FuncSet.

The arguments that define an impact function where not
specified with keywords when Impct.Func were called
to initialize an arbitrarly imp_fun, additionaly there where in
a different order in respect to the __init__ function of ImpactFunc.
Therefore, when calling Impact.Func.mdd, Impact.Func.paa and
Impact.Func.intensity, the following wrong outputs were produced.

imp_fun.intensity was instanciated as intensity units
imp_fun.intensity_unit was instanciated as mdd
imp_fun.name  was instanciated as paa
imp_fun.haz_type  was instanciated as id
imp_fun.paa  was instanciated as intesity

Therefore when u_check was called to check that the size of the
intensity is equal to the size of mdd and paa, it was not comparing
the actual real intesities, mdd and paa, but the above values.

By specifyng the arguments as in the next paragraph, u_check,
situtated in: climada/entity/impact_funcs/base.py, compare that
the size of the real intensity is equal to the size of the real mdd
and paa.

Specification of the arguments with keyword:

imp_fun = ImpactFunc(id=id, name=name, intensity_unit=intensity_unit,
 haz_type=haz_type, intensity=intensity, mdd=mdd, paa=paa)
@peanutfun peanutfun changed the base branch from main to develop January 5, 2023 12:33
Copy link
Member

@peanutfun peanutfun left a comment

Choose a reason for hiding this comment

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

Great, thank you! I took the liberty of running a formatter over the two code cells you changed.

@peanutfun peanutfun merged commit 39073f8 into develop Jan 6, 2023
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.

2 participants