diff --git a/build/lib/muller_eot/calculate_eot.py b/build/lib/muller_eot/calculate_eot.py index 2f781f2..2d8a7d9 100644 --- a/build/lib/muller_eot/calculate_eot.py +++ b/build/lib/muller_eot/calculate_eot.py @@ -30,7 +30,9 @@ def calculateDifferenceEOTMinutes(eccentricity=None, orbit_period=None): # Calculate the time difference (in minutes) for the Equation of Time - muller_eot.errorHandlingEOT(eccentricity, obliquity_deg, orbit_period) + muller_eot.errorHandlingEOT(eccentricity, + obliquity_deg, + orbit_period) # Verify argument behavior distance_between_solistice_perhelion_deg = muller_eot.calculateDistanceBetweenSolisticePerhelion() distance_between_solistice_perhelion_rad = np.deg2rad(distance_between_solistice_perhelion_deg) @@ -87,7 +89,7 @@ def calculateDifferenceEOTMinutes(eccentricity=None, return eot_mins def plotEOT(planet_name=None, - orbital_period=[], + orbital_period=None, eot_y=[], effect_title_str=None, figsize_n=12, @@ -95,7 +97,13 @@ def plotEOT(planet_name=None, save_plot_name=None): # Plot EOT Time Differences - muller_eot.errorHandlingPlotEOT(planet_name, orbital_period, eot_y, effect_title_str, figsize_n, figsize_dpi, save_plot_name) + muller_eot.errorHandlingPlotEOT(planet_name, + orbital_period, + eot_y, + effect_title_str, + figsize_n, + figsize_dpi, + save_plot_name) # Verify argument behavior fig = plt.figure(figsize=(figsize_n,figsize_n), dpi=figsize_dpi) diff --git a/build/lib/muller_eot/error_handling.py b/build/lib/muller_eot/error_handling.py index af274c5..28db52c 100644 --- a/build/lib/muller_eot/error_handling.py +++ b/build/lib/muller_eot/error_handling.py @@ -14,21 +14,30 @@ def errorHandlingEOT(eccentricity, orbit_period): # Ensure that eccentricity is a float or int - if type(eccentricity) != int and type(eccentricity) != float: + if eccentricity is not None and type(eccentricity) != int and type(eccentricity) != float: logger.critical("\nCRITICAL ERROR, [eccentricity]: Must be a int or float, current type = '{0}'".format(type(eccentricity))) exit() + if eccentricity is None: + logger.critical("\nCRITICAL ERROR, [eccentricity]: Must be a int or float, currently is 'None'") + exit() logger.debug("eccentricity = '{0}'".format(eccentricity)) # Ensure that obliquity_deg is a float or int - if type(obliquity_deg) != int and type(obliquity_deg) != float: + if obliquity_deg is not None and type(obliquity_deg) != int and type(obliquity_deg) != float: logger.critical("\nCRITICAL ERROR, [obliquity_deg]: Must be a int or float, current type = '{0}'".format(type(obliquity_deg))) exit() + if obliquity_deg is None: + logger.critical("\nCRITICAL ERROR, [obliquity_deg]: Must be a int or float, currently is 'None'") + exit() logger.debug("obliquity_deg = '{0}'".format(obliquity_deg)) # Ensure that orbit_period is a float or int - if type(orbit_period) != int and type(orbit_period) != float: + if orbit_period is not None and type(orbit_period) != int and type(orbit_period) != float: logger.critical("\nCRITICAL ERROR, [orbit_period]: Must be a int or float, current type = '{0}'".format(type(orbit_period))) exit() + if orbit_period is None: + logger.critical("\nCRITICAL ERROR, [orbit_period]: Must be a int or float, currently is 'None'") + exit() logger.debug("orbit_period = '{0}'".format(orbit_period)) def errorHandlingPlotEOT(planet_name, @@ -43,25 +52,40 @@ def errorHandlingPlotEOT(planet_name, if type(planet_name) != str: logger.critical("\nCRITICAL ERROR, [planet_name]: Must be a str, current type = '{0}'".format(type(planet_name))) exit() + if planet_name is None: + logger.critical("\nCRITICAL ERROR, [planet_name]: Must be a int or float, currently is 'None'") + exit() logger.debug("planet_name = '{0}'".format(planet_name)) # Ensure that orbital_period is a float or int if type(orbital_period) != int and type(orbital_period) != float: logger.critical("\nCRITICAL ERROR, [orbital_period]: Must be a int or float, current type = '{0}'".format(type(orbital_period))) exit() + if orbital_period is None: + logger.critical("\nCRITICAL ERROR, [orbital_period]: Must be a int or float, currently is 'None'") + exit() logger.debug("orbital_period = '{0}'".format(orbital_period)) # Ensure that all y values for minute differences is a float or int + if type(eot_y) is not list: + logger.critical("\nCRITICAL ERROR, [eot_y]: Must be a list, currently is '{0}'".format(type(eot_y))) + exit() for minute_dif in eot_y: if type(minute_dif) != int and type(minute_dif) != float: - logger.critical("\nCRITICAL ERROR, [minute_dif]: Must be a int or float, current type = '{0}'".format(type(minute_dif))) + logger.critical("\nCRITICAL ERROR, [eot_y]: Must be a int or float, current type = '{0}'".format(type(minute_dif))) exit() - logger.debug("minute_dif = '{0}'".format(minute_dif)) + if len(eot_y) < 1: + logger.critical("\nCRITICAL ERROR, [eot_y]: Must have a length greater than zero") + exit() + logger.debug("eot_y = '{0}'".format(eot_y)) # Ensure that the effect title type is a string if type(effect_title_str) != str: logger.critical("\nCRITICAL ERROR, [effect_title_str]: Must be a str, current type = '{0}'".format(type(effect_title_str))) exit() + if effect_title_str is None: + logger.critical("\nCRITICAL ERROR, [effect_title_str]: Must be a str, currently is 'None'") + exit() logger.debug("effect_title_str = '{0}'".format(effect_title_str)) # Ensure that all figsize_n is a float or int diff --git a/dist/muller-eot-0.0.4.tar.gz b/dist/muller-eot-0.0.4.tar.gz deleted file mode 100644 index 9949e51..0000000 Binary files a/dist/muller-eot-0.0.4.tar.gz and /dev/null differ diff --git a/dist/muller-eot-1.0.0.tar.gz b/dist/muller-eot-1.0.0.tar.gz new file mode 100644 index 0000000..d28c822 Binary files /dev/null and b/dist/muller-eot-1.0.0.tar.gz differ diff --git a/dist/muller_eot-0.0.4-py3-none-any.whl b/dist/muller_eot-0.0.4-py3-none-any.whl deleted file mode 100644 index 79eb142..0000000 Binary files a/dist/muller_eot-0.0.4-py3-none-any.whl and /dev/null differ diff --git a/dist/muller_eot-1.0.0-py3-none-any.whl b/dist/muller_eot-1.0.0-py3-none-any.whl new file mode 100644 index 0000000..163916d Binary files /dev/null and b/dist/muller_eot-1.0.0-py3-none-any.whl differ