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

Add tests for module compression_heatpumps_and_chillers #57

Merged
merged 11 commits into from
Feb 12, 2020

Conversation

jakob-wo
Copy link
Contributor

  1. This PR adds tests for the module compression_heatpumps_and_chillers.py.

It also includes two additional changes (I know, I should have done this in seperate PRs - sry!)
2) The PR fixes the docstring of a pre-calculation-function. Before it said the input argument had to be of type list but in fact it can be a pandas.Series as well. I added that information to the docstring.

  1. The PR adds Exceptions to the module: It is checked whether the input arguments have the proper type and length.

@jakob-wo jakob-wo requested a review from jnnr January 22, 2020 13:27
@jnnr
Copy link
Member

jnnr commented Jan 22, 2020

Thanks for the tests! Looks good, just some minor remarks.

Jakob Wolf added 3 commits January 23, 2020 16:16
- to check if calculation works with pd.Series as input
- improve readability of exceptions
- Remove argument 'consider_icing' in calc_cop
- New: argument 'factor_icing' alone triggers icing to be considered
@jakob-wo
Copy link
Contributor Author

Good feedback!
I like your ideas, implemented all requested changes and adjusted the examples to work without the argument 'consider_icing'.

# Combining 'consider_icing' and mode 'chiller' is not possible!
cops = None

raise ValueError('Argument factor ising has '
Copy link
Member

@jnnr jnnr Jan 27, 2020

Choose a reason for hiding this comment

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

Suggested change
raise ValueError('Argument factor ising has '
raise ValueError("Argument factor_icing has "

cops = None

raise ValueError('Argument factor ising has '
'to be None for mode=chiller!')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'to be None for mode=chiller!')
"to be None for mode='chiller'!")

@@ -139,6 +158,9 @@ def calc_max_Q_dot_chill(nominal_conditions, cops):


"""
if not isinstance(cops, list):
raise TypeError('Argument cops is not of type list!')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
raise TypeError('Argument cops is not of type list!')
raise TypeError("Argument 'cops' is not of type list!")

@jnnr
Copy link
Member

jnnr commented Jan 27, 2020

Thanks, looks good. Just a little suggestion in for the error messages. Apart from that, it could be merged.

In another PR, you could implement the functionality of giving back a pd.Series as result when passing one as input. But that can be dealt with separately.

@jakob-wo jakob-wo merged commit 3dfbe57 into dev Feb 12, 2020
@jakob-wo jakob-wo deleted the features/compr_heatpumps_add_tests branch February 12, 2020 10:35
@jnnr jnnr added this to the v0.0.2 milestone Apr 20, 2020
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