Skip to content

Conversation

@jgaffiot
Copy link

@jgaffiot jgaffiot commented Dec 7, 2018

return system


@pytest.fixture
Copy link

Choose a reason for hiding this comment

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

F811 redefinition of unused 'sam_data' from line 22

Copy link
Author

Choose a reason for hiding this comment

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

Same as lines 26, 40... I think this is a linter error.

Copy link
Member

Choose a reason for hiding this comment

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

agree

module = 'Canadian_Solar_CS5P_220M'
module_parameters = sam_data['cecmod'][module].copy()
inverters = sam_data['cecinverter']
inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy()
Copy link

Choose a reason for hiding this comment

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

E501 line too long (80 > 79 characters)

Copy link
Author

@jgaffiot jgaffiot Dec 7, 2018

Choose a reason for hiding this comment

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

Same as lines 32, 49... (which I copied). Should I change ?

Copy link
Author

Choose a reason for hiding this comment

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

By the way you may be interested by black to definitively get rid of formatting problems.

Copy link
Member

Choose a reason for hiding this comment

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

Fine with me to leave this because I'd like to refactor all of these fixtures.

Thanks for the tip.

@jgaffiot
Copy link
Author

jgaffiot commented Dec 7, 2018

Travis error seems strange to me (only for Python3.6) :

ImportError while loading conftest '/home/travis/build/pvlib/pvlib-python/pvlib/test/conftest.py'.
pvlib/test/conftest.py:8: in <module>
    import pvlib
pvlib/__init__.py:12: in <module>
    from pvlib import spa
pvlib/spa.py:259: in <module>
    TABLE_1_DICT['L1'].resize((64, 3))
E   ValueError: cannot resize an array that references or is referenced
E   by another array in this way.  Use the resize function

Lack of "require_scipy" on a test ? Tests pass on my computer under Python3.6.7.

Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

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

Looks good, but please add your name and/or username to the Contributors list at the bottom of the whatsnew file.

The test failure is unrelated and can be ignored.

return system


@pytest.fixture
Copy link
Member

Choose a reason for hiding this comment

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

agree

module = 'Canadian_Solar_CS5P_220M'
module_parameters = sam_data['cecmod'][module].copy()
inverters = sam_data['cecinverter']
inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy()
Copy link
Member

Choose a reason for hiding this comment

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

Fine with me to leave this because I'd like to refactor all of these fixtures.

Thanks for the tip.

return system


@pytest.fixture
Copy link

Choose a reason for hiding this comment

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

F811 redefinition of unused 'sam_data' from line 22

module = 'Canadian_Solar_CS5P_220M'
module_parameters = sam_data['cecmod'][module].copy()
inverters = sam_data['cecinverter']
inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy()
Copy link

Choose a reason for hiding this comment

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

E501 line too long (80 > 79 characters)

'system.module_parameters. Check that the '
'parameters contain valid '
'first_solar_spectral_coefficients or a valid '
'first_solar_spectral_coefficients and a valid '
Copy link
Member

Choose a reason for hiding this comment

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

I still think this should be or. If Technology or Material is not in params, then attempt to identify the cell type. Or find 'first_solar_spectral_coefficients`.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @cwhanse for catching this. I agree that or describes the logic. @jgaffiot can you revert this change?

Unrelated to this change, but the error message also neglects the possibility of using sapm_spectral_loss.

Copy link
Author

Choose a reason for hiding this comment

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

I changed the comment because the code says 'and' line 624:

     elif ((('Technology' in params or
            'Material' in params) and
           (pvsystem._infer_cell_type() is not None)) or
           (self.system._infer_cell_type() is not None)) or
          'first_solar_spectral_coefficients' in params): 

Copy link
Author

Choose a reason for hiding this comment

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

I change the code too ?

Copy link
Member

@cwhanse cwhanse Dec 7, 2018

Choose a reason for hiding this comment

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

No change to the code, only the comment.
(('Technology' in params or 'Material' in params) and (self.system._infer_cell_type() is not None))
is all one clause, that is OR-ed with the last clause. The and is inside. _infer_cell_type tries to set Technology and Material if those kwargs aren't given.

That compound logic statement could be presented more clearly using multiple lines.

return system


@pytest.fixture
Copy link

Choose a reason for hiding this comment

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

F811 redefinition of unused 'sam_data' from line 22

module = 'Canadian_Solar_CS5P_220M'
module_parameters = sam_data['cecmod'][module].copy()
inverters = sam_data['cecinverter']
inverter = inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'].copy()
Copy link

Choose a reason for hiding this comment

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

E501 line too long (80 > 79 characters)

@wholmgren
Copy link
Member

thanks @jgaffiot !

@wholmgren wholmgren merged commit d979187 into pvlib:master Dec 10, 2018
@wholmgren wholmgren added this to the 0.6.1 milestone Jan 21, 2019
@wholmgren wholmgren added the bug label Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants