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

Remove defaults #107

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open

Remove defaults #107

wants to merge 17 commits into from

Conversation

Pizza2Pizza
Copy link
Collaborator

@Pizza2Pizza Pizza2Pizza commented Sep 24, 2024


📚 Documentation preview 📚: https://portfolyo--107.org.readthedocs.build/en/107/

@Pizza2Pizza Pizza2Pizza linked an issue Sep 24, 2024 that may be closed by this pull request
Copy link
Owner

@rwijtvliet rwijtvliet left a comment

Choose a reason for hiding this comment

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

i haven't been able look at the tests in very much detail

@@ -120,19 +119,21 @@ To pass several timeseries, we can use:
import pandas as pd
idx = pd.date_range("2023", freq="YS", periods=2)
# --- hide: stop ---
pd.DataFrame({"p": [50, 56], "w": [120, 125]}, idx)
df = pd.DataFrame(dict_of_tseries)
Copy link
Owner

Choose a reason for hiding this comment

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

I think you'll need to re-define the dict_of_tseries object for this to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -49,16 +50,15 @@ class InOp:
p: tools.unit.Q_ | pd.Series = None
r: tools.unit.Q_ | pd.Series = None
nodim: tools.unit.Q_ | pd.Series = None # explicitly dimensionless
agn: float | pd.Series = None # agnostic
agn: float | pd.Series = None # agnostic TODO factor out
Copy link
Owner

Choose a reason for hiding this comment

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

this can be removed yet maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

return create.flatpfline(
pd.DataFrame(
{
"q": [Q_(0, "MWh") for _ in range(len(ref_idx))],
Copy link
Owner

Choose a reason for hiding this comment

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

Here it's probably faster to do pd.DataFrame({'q': pd.Series(0, ref_idx, dtype='pint[MWh]', 'r': pd.Series(0, ref_idx, dtype='pint[Eur]'})

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not so easy to adapt tests to this change, didn't have time to change

@@ -36,21 +36,31 @@
"nodim": ureg.dimensionless,
}

NAMES_AND_DIMENSIONS = {
"w": ureg.MW.dimensionality,
Copy link
Owner

Choose a reason for hiding this comment

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

Can we get rid of the specific units?

{ 
'w': ureg.get_dimensionality({'[energy]': 1, '[time]': -1}),
'q': ureg.get_dimensionality({'[energy]': 1}),
'p': ureg.get_dimensionality({'[currency]': 1, '[energy]': -1}),
'r': ureg.get_dimensionality({'[currency]': 1}),
'duration': ureg.get_dimensionality({'[time]': 1}),
't': ureg.get_dimensionality({'[temperature]': 1}),
'nodim': ureg.get_dimensionality({}),
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

# }


def get_value(
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a reason why this function is defined here, instead of changing and using the function in dev?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not really, changed the location

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.

[enhancement] remove default units
2 participants