From 64469c491ebd8a6b7101a0afe83df999563feb02 Mon Sep 17 00:00:00 2001 From: cdeline Date: Sun, 6 Oct 2024 19:54:38 -0600 Subject: [PATCH] Deprecation warnings for load.deepcleanResult and mismatch.analysisIrradianceandPowerMismatch --- bifacial_radiance/load.py | 11 ++++++++++- bifacial_radiance/main.py | 22 +--------------------- bifacial_radiance/mismatch.py | 5 +++-- docs/sphinx/source/whatsnew/pending.rst | 2 ++ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/bifacial_radiance/load.py b/bifacial_radiance/load.py index d60846ca..42f2e547 100644 --- a/bifacial_radiance/load.py +++ b/bifacial_radiance/load.py @@ -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): """ @@ -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 @@ -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 @@ -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 diff --git a/bifacial_radiance/main.py b/bifacial_radiance/main.py index 70340eaa..5ae244c6 100644 --- a/bifacial_radiance/main.py +++ b/bifacial_radiance/main.py @@ -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'}) @@ -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 diff --git a/bifacial_radiance/mismatch.py b/bifacial_radiance/mismatch.py index 2def94f8..5371b187 100644 --- a/bifacial_radiance/mismatch.py +++ b/bifacial_radiance/mismatch.py @@ -5,7 +5,7 @@ @author: sayala """ -#from load import * +from deprecated import deprecated @@ -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 diff --git a/docs/sphinx/source/whatsnew/pending.rst b/docs/sphinx/source/whatsnew/pending.rst index 17224bae..7e0762d4 100644 --- a/docs/sphinx/source/whatsnew/pending.rst +++ b/docs/sphinx/source/whatsnew/pending.rst @@ -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 ~~~~~~~~~