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

Added the minimal example #257

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Added the minimal example #257

merged 3 commits into from
Dec 1, 2023

Conversation

nick-harder
Copy link
Member

-added the first small jupyter example
-added it to the documentation
-improved docstrings for world class
-improved docstrings for forecast class
-adjusted the structure of documentation index
-adjusted structure of automated docs
-small fixes in several other docstings

-added the first small jupyter example
-added it to the documentation
-improved docstrings for world class
-improved docstrings for forecast class
-adjusted the structure of documentation index
-adjusted structure of automated docs
-small fixes in several other docstings
Methods:
- __getitem__(self, column: str) -> pd.Series: Returns the forecast for a given column.
- get_availability(self, unit: str) -> pd.Series: Returns the availability of a given unit.
- get_price(self, fuel_type: str) -> pd.Series: Returns the price for a given fuel type or zeros if
Copy link
Member

Choose a reason for hiding this comment

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

This should not list available methods here too?
As this is provided directly from below - and we have docs per method, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

If they are removed here, will they still be visible in hints when coding? So you can see them directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

tbh I am not sure about common practices. Please advise

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, other packages don't do that. Is removed now. although somehow I would find it pretty cool if you could directly see available methods as a hint

Copy link
Member

Choose a reason for hiding this comment

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

I just write:
object. then the IDE hints show which methods are available, which is mostly sufficient for me?

Other than that, I like clicking on the breadcrumbs in the menu to see an outline of my current open file:

image

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5db9076) 78.44% compared to head (226d6c0) 78.44%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #257   +/-   ##
=======================================
  Coverage   78.44%   78.44%           
=======================================
  Files          39       39           
  Lines        4259     4259           
=======================================
  Hits         3341     3341           
  Misses        918      918           
Flag Coverage Δ
pytest 78.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nick-harder nick-harder requested a review from maurerle December 1, 2023 13:41
Copy link
Member

@maurerle maurerle left a comment

Choose a reason for hiding this comment

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

We now have two different doc styles used in Assume.
Feel free to fix this now or in some time later.
I think that the added explanations are very useful and we can bulk convert the existing docs probably too.

I'll just approve without merge now.
I did not view the docs myself, but only looked at the github diff.

data_format = "timescale" # "local_db" or "timescale"
example = "learning_small"
data_format = "local_db" # "local_db" or "timescale"
example = "small"
Copy link
Member

Choose a reason for hiding this comment

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

Is this change inteded?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, since we don't expected people to already have docker running when using this small example.

5. Aggregates the fuel cost, emissions cost, and fixed cost to obtain the marginal cost of the
power plant.

Returns the resulting marginal cost as a float value.
Copy link
Member

Choose a reason for hiding this comment

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

If we want, we can change the docstring format from the default sphinx one:
https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#an-example-class-with-docstrings

to Google Doc strings or Numpy doc strings:
https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html#example-google
or
https://www.sphinx-doc.org/en/master/usage/extensions/example_numpy.html#example-numpy

which adds the napoleon plugin.
But I think we should use the same code style all over assume.

Copy link
Member Author

Choose a reason for hiding this comment

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

please explain, I don't understand

Copy link
Member

Choose a reason for hiding this comment

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

Your doc style in this PR (Google Style) does not match the docstyle currently used (sphinx style) in all other files

sphinx style is this one:

:return: `True` if connection was successful, `False` otherwise
:rtype: bool

Copy link
Member

Choose a reason for hiding this comment

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

Actually this isn't even google Style docs but something weird inbetween - Probably just a Copilot suggestion?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, I get it now. So what I have written, it is basically google form with some extra explanation at the end. We can discuss this next time if we wanna keep it and convert existing stuff to it. I find it personally extremely helpful. Let's keep it for now and talk about it during a development meeting.

@nick-harder nick-harder merged commit afae9d8 into main Dec 1, 2023
4 checks passed
@nick-harder nick-harder deleted the simple-example-notebook branch December 1, 2023 13:59
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