Skip to content

Commit

Permalink
v1.0.0 build/dist
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Nov 27, 2022
1 parent b08e9f5 commit 9126c25
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
14 changes: 11 additions & 3 deletions build/lib/muller_eot/calculate_eot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -87,15 +89,21 @@ 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,
figsize_dpi=100,
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)

Expand Down
34 changes: 29 additions & 5 deletions build/lib/muller_eot/error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
Binary file removed dist/muller-eot-0.0.4.tar.gz
Binary file not shown.
Binary file added dist/muller-eot-1.0.0.tar.gz
Binary file not shown.
Binary file removed dist/muller_eot-0.0.4-py3-none-any.whl
Binary file not shown.
Binary file added dist/muller_eot-1.0.0-py3-none-any.whl
Binary file not shown.

0 comments on commit 9126c25

Please sign in to comment.