-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
Are you sure you want to change the base?
Remove defaults #107
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
portfolyo/core/pfline/interop.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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))], |
There was a problem hiding this comment.
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]'})
There was a problem hiding this comment.
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
portfolyo/tools/unit.py
Outdated
@@ -36,21 +36,31 @@ | |||
"nodim": ureg.dimensionless, | |||
} | |||
|
|||
NAMES_AND_DIMENSIONS = { | |||
"w": ureg.MW.dimensionality, |
There was a problem hiding this comment.
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({}),
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# } | ||
|
||
|
||
def get_value( |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
📚 Documentation preview 📚: https://portfolyo--107.org.readthedocs.build/en/107/