Skip to content

Commit

Permalink
Deprecation warnings for load.deepcleanResult and mismatch.analysisIr…
Browse files Browse the repository at this point in the history
…radianceandPowerMismatch
  • Loading branch information
cdeline committed Oct 7, 2024
1 parent 2a178e1 commit 64469c4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
11 changes: 10 additions & 1 deletion bifacial_radiance/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
TEMP folder in bifacial_radiance \\ bifacial_radiance
"""
from deprecated import deprecated

''' DEPRECATED - doesn't work with python3
def load_inputvariablesfile(inputfile):
"""
Expand Down Expand Up @@ -235,7 +237,7 @@ def loadTrackerDict(trackerdict, fileprefix=None):
``finalkey`` (last index file in directory)
"""

# TODO: get this module working
import re, os
import numpy as np

Expand Down Expand Up @@ -327,6 +329,9 @@ def _exportTrackerDict(trackerdict, savefile, reindex):
d.to_csv(savefile)


@deprecated(reason='load.deepcleanResult has been abandoned'+\
' Please use load.cleanResult instead',
version='0.5.0')
def deepcleanResult(resultsDict, sensorsy, numpanels, automatic=True):
"""
Cleans results file read by read1Result. If automatic = False, user is
Expand All @@ -335,6 +340,10 @@ def deepcleanResult(resultsDict, sensorsy, numpanels, automatic=True):
If you pass in results from a file with only _Front or _Back parameters,
only the corresponding Frontresults or Backresults will be returned.
.. deprecated:: 0.5.0
This cleaning routine is deprecated in favor of :func:`cleanResult` which
is more stable
Parameters
-----------
sensorsy : int
Expand Down
22 changes: 1 addition & 21 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,22 +359,6 @@ class RadianceObj(SuperClass):
_setPath : change the working directory
"""

@property
def Wm2Front(self):
return self._Wm2Front
@Wm2Front.setter
def Wm2Front(self, value):
self._Wm2Front = value

@Wm2Front.getter
@deprecated(reason='RadianceObj.Wm2Front will be abandoned'+\
' by v0.5.0. Please use values recorded in ' +
' AnalysisObj.Wm2Front or RadianceObj.results')
def Wm2Front(self):
return self._Wm2Front


def __repr__(self):
#return str(self.__dict__)
return str(type(self)) + ' : ' + str({key: self.__dict__[key] for key in self.columns if key != 'trackerdict'})
Expand Down Expand Up @@ -405,11 +389,7 @@ def __init__(self, name=None, path=None, hpc=False):
self.skyfiles = [] # skyfiles for oconv
self.radfiles = [] # scene rad files for oconv
self.octfile = [] #octfile name for analysis

self._Wm2Front = 0 # cumulative tabulation of front W/m2



self.Wm2Front = 0 # cumulative tabulation of front W/m2
self.Wm2Back = 0 # cumulative tabulation of rear W/m2
self.backRatio = 0 # ratio of rear / front Wm2
#self.nMods = None # number of modules per row
Expand Down
5 changes: 3 additions & 2 deletions bifacial_radiance/mismatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@author: sayala
"""

#from load import *
from deprecated import deprecated



Expand Down Expand Up @@ -300,7 +300,8 @@ def _mad_1D(data): #1D calculation of MAD
return _mad_1D(data)



@deprecated(reason='This analysis script will be moved to its own tutorial' +\
' file in a future release.', version='0.5.0')
def analysisIrradianceandPowerMismatch(testfolder, writefiletitle, portraitorlandscape, bififactor, numcells=72, downsamplingmethod='byCenter'):
r'''
Use this when sensorsy calculated with bifacial_radiance > cellsy
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/pending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Enhancements
Deprecations
~~~~~~~~~~~~~~
* .ini files loaded with :py:func:`bifacial_radiance.load.readconfigurationinputfile` use `azimuth` key instead of `axis_azimuth` (:issue:`438`)(:pull:`551`)
* :py:func:`bifacial_radiance.load.deepcleanResult` is now deprecated in favor of :py:func:`~bifacial_radiance.load.cleanResult` (:issue:`556`)
* :py:func:`bifacial_radiance.mismatch.analysisIrradianceandPowerMismatch` is being removed to its own example notebook in a future release. (:issue:`556`)

Bug fixes
~~~~~~~~~
Expand Down

0 comments on commit 64469c4

Please sign in to comment.