# Path: ish_parser/Distance.py
# class Distance(Observation):
#   ''' observation of a temperature, which we can convert
#   between farenheight and celsius, yay '''
#   MILLIMETERS = 1
#   METERS = 2
#   INCHES = 3
#   MISSING = [999, 99999, 999999]
#   # Inches per cm
#   INCH_CONVERSION_FACTOR = 1/2.54
# 
#   def get_inches(self):
#     ''' convert the measurement to inches '''
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     if self._obs_units == self.MILLIMETERS:
#       return round(self._obs_value / 10 * self.INCH_CONVERSION_FACTOR, 4)
#     if self._obs_units == self.METERS:
#       return round(self._obs_value * 100 * self.INCH_CONVERSION_FACTOR, 4)
# 
#   def get_miles(self):
#     ''' convert the measurement to inches '''
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     if self._obs_units == self.MILLIMETERS:
#       return round(self._obs_value / 10 * self.INCH_CONVERSION_FACTOR / 12 / 5280, 4)
#     if self._obs_units == self.METERS:
#       return round(self._obs_value * 100 * self.INCH_CONVERSION_FACTOR / 12 / 5280, 4)
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
# Path: ish_parser/CloudCoverage.py
# class CloudCoverage(Observation):
#   '''okta is a unit of measurement used to 
#   describe the amount of cloud cover at any given location such 
#   as a weather station. Sky conditions are estimated in 
#   terms of how many eighths of the sky are covered in cloud, 
#   ranging from 0 oktas (completely clear sky) through to 
#   8 oktas (completely overcast).
#   '''
#   OKTA = 1
#   MISSING = ['99', 99]
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def __repr__(self):
#     return self.__str__()
# 
#   def __eq__(self, value2):
#     if self._obs_value == value2:
#       return True
#     else:
#       return False
# 
# Path: ish_parser/Constant.py
# class Constant(Observation):
#   ''' constant is for constant variables that have types
#   or indices associated with them like types of clouds, etc'''
#   MISSING = ["99"]
# 
#   def __str__(self):
#     if self._obs_value in self._obs_index.keys():
#       return self._obs_index.get(self._obs_value)
#     elif self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def __repr__(self):
#     return repr(self.__str__())
# 
#   def __eq__(self, value2):
#     return("P")
#     if self._obs_value in self._obs_index.keys():
#       if self._obs_index.get(self._obs_value) == value2:
#         return True
# 
#     if str(self) == str(value2):
#       return True
#     else:
#       return False
# 
# Path: ish_parser/Components/BaseComponent.py
# class BaseComponent(object):
#   ''' base component handler '''


from ..Distance import Distance
from ..CloudCoverage import CloudCoverage
from ..Constant import Constant
from .BaseComponent import BaseComponent
  CLOUD_TYPES = {
    "00": "Cirrus (Ci)",
    "01": "Cirrocumulus (Cc)",
    "02": "Cirrostratus (Cs)",
    "03": "Altocumulus (Ac)",
    "04": "Altostratus (As)",
    "05": "Nimbostratus (Ns)",
    "06": "Stratocumulus (Sc)",
    "07": "Stratus (St)",
    "08": "Cumulus (Cu)",
    "09": "Cumulonimbus (Cb)",
    "10": """Cloud not visible owing to darkness, fog,
           duststorm, sandstorm, or other analogous phenomena / sky obscured""",
    "11": "Not used",
    "12": "Towering Cumulus (Tcu)",
    "13": "Stratus fractus (Stfra)",
    "14": "Stratocumulus Lenticular (Scsl)",
    "15": "Cumulus Fractus (Cufra)",
    "16": "Cumulonimbus Mammatus (Cbmam)",
    "17": "Altocumulus Lenticular (Acsl)",
    "18": "Altocumulus Castellanus (Accas)",
    "19": "Altocumulus Mammatus (Acmam)",
    "20": "Cirrocumulus Lenticular (Ccsl)",
    "21": "Cirrus and/or Cirrocumulus",
    "22": "Stratus and/or Fracto-stratus",
    "23": "Cumulus and/or Fracto-cumulus"}
  
  def loads(self, string):
    self.sky_cover = {
      'coverage': CloudCoverage(string[0:2],

# Path: ish_parser/Distance.py
# class Distance(Observation):
#   ''' observation of a temperature, which we can convert
#   between farenheight and celsius, yay '''
#   MILLIMETERS = 1
#   METERS = 2
#   INCHES = 3
#   MISSING = [999, 99999, 999999]
#   # Inches per cm
#   INCH_CONVERSION_FACTOR = 1/2.54
# 
#   def get_inches(self):
#     ''' convert the measurement to inches '''
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     if self._obs_units == self.MILLIMETERS:
#       return round(self._obs_value / 10 * self.INCH_CONVERSION_FACTOR, 4)
#     if self._obs_units == self.METERS:
#       return round(self._obs_value * 100 * self.INCH_CONVERSION_FACTOR, 4)
# 
#   def get_miles(self):
#     ''' convert the measurement to inches '''
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     if self._obs_units == self.MILLIMETERS:
#       return round(self._obs_value / 10 * self.INCH_CONVERSION_FACTOR / 12 / 5280, 4)
#     if self._obs_units == self.METERS:
#       return round(self._obs_value * 100 * self.INCH_CONVERSION_FACTOR / 12 / 5280, 4)
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
# Path: ish_parser/CloudCoverage.py
# class CloudCoverage(Observation):
#   '''okta is a unit of measurement used to 
#   describe the amount of cloud cover at any given location such 
#   as a weather station. Sky conditions are estimated in 
#   terms of how many eighths of the sky are covered in cloud, 
#   ranging from 0 oktas (completely clear sky) through to 
#   8 oktas (completely overcast).
#   '''
#   OKTA = 1
#   MISSING = ['99', 99]
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def __repr__(self):
#     return self.__str__()
# 
#   def __eq__(self, value2):
#     if self._obs_value == value2:
#       return True
#     else:
#       return False
# 
# Path: ish_parser/Constant.py
# class Constant(Observation):
#   ''' constant is for constant variables that have types
#   or indices associated with them like types of clouds, etc'''
#   MISSING = ["99"]
# 
#   def __str__(self):
#     if self._obs_value in self._obs_index.keys():
#       return self._obs_index.get(self._obs_value)
#     elif self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def __repr__(self):
#     return repr(self.__str__())
# 
#   def __eq__(self, value2):
#     return("P")
#     if self._obs_value in self._obs_index.keys():
#       if self._obs_index.get(self._obs_value) == value2:
#         return True
# 
#     if str(self) == str(value2):
#       return True
#     else:
#       return False
# 
# Path: ish_parser/Components/BaseComponent.py
# class BaseComponent(object):
#   ''' base component handler '''


# Path: ish_parser/Components/SkyCoverComponent.py
from ..Distance import Distance
from ..CloudCoverage import CloudCoverage
from ..Constant import Constant
from .BaseComponent import BaseComponent

  CLOUD_TYPES = {
    "00": "Cirrus (Ci)",
    "01": "Cirrocumulus (Cc)",
    "02": "Cirrostratus (Cs)",
    "03": "Altocumulus (Ac)",
    "04": "Altostratus (As)",
    "05": "Nimbostratus (Ns)",
    "06": "Stratocumulus (Sc)",
    "07": "Stratus (St)",
    "08": "Cumulus (Cu)",
    "09": "Cumulonimbus (Cb)",
    "10": """Cloud not visible owing to darkness, fog,
           duststorm, sandstorm, or other analogous phenomena / sky obscured""",
    "11": "Not used",
    "12": "Towering Cumulus (Tcu)",
    "13": "Stratus fractus (Stfra)",
    "14": "Stratocumulus Lenticular (Scsl)",
    "15": "Cumulus Fractus (Cufra)",
    "16": "Cumulonimbus Mammatus (Cbmam)",
    "17": "Altocumulus Lenticular (Acsl)",
    "18": "Altocumulus Castellanus (Accas)",
    "19": "Altocumulus Mammatus (Acmam)",
    "20": "Cirrocumulus Lenticular (Ccsl)",
    "21": "Cirrus and/or Cirrocumulus",
    "22": "Stratus and/or Fracto-stratus",
    "23": "Cumulus and/or Fracto-cumulus"}
  
  def loads(self, string):
    self.sky_cover = {
      'coverage': CloudCoverage(string[0:2],

        CloudCoverage.OKTA, string[2:3]),