Repository: cunybpl/isdparser

Issue:
Whitespace is Measure mappings' keys.
Whitespaces are being encountered in `GEOPHYSICAL-POINT-OBSERVATION` mappings; specifically, 'SOD' and 'SOM'. Those two codes/keys come with whitespaces from NOAA: `SOD  ` and `SOM  `.
```
1218725030147322010010104596+40779-073881SOD  +0009KLGA V030999999999999999999999999999+99999+99999999999ADDAA124005695AJ100009599999999AN1024004395AT1AU16RA  5AT2AU18SN  5AT3AU04PL  5AT4AU22FZFG5AT5AU13BR  5AT6AU08HZ  5AT7AW01FG  5AX1016246AX2086246KA1240M+00115KA2240N-00105KG1024W-0011D4KG2024D-0033D4MF1102074102104MG1102074101594OE11240071522001175OE22240053621008045OE33240020699999995RH1024X092D4RH2024N049D4RH3024M078D4REMSOD82024 HR PRECIPITATION (IN):0.22  SNOW DEPTH (IN):0     24 HR SNOWFALL (IN):1.7  WEATHER(CODE):1,8  24 HR MAX TEMP (F):34 24 HR MAX TEMP TIME (LST):2359 24 HR MIN TEMP (F):30 24 HR MIN TEMP TIME (LST):0937 AVERAGE STATION PRESSURE:30.140 MINIMUM SEA LEVEL PRESSURE:30.00 TIME OF OCCURRENCE:2359 PEAK WIND SPEED (MPH):16  PEAK WIND DIR (DEG):220 PEAK WIND TIME (LST):0117  FASTEST 2MIN SPEED (MPH):12 FASTEST 2MIN DIR (DEG):210 FASTEST 2MIN TIME (LST):0804 AVERAGE WIND SPEED (MPH):4.6  24 HR AVG TEMP (F):32 DEPART FROM NORMAL: -2  HEATING DEGREE DAYS:33  COOLING DEGREE DAYS:0   LATEST DAY MAX TEMP (0700-1900 LST):34  LATEST NIGHT MIN TEMP(1900-0800 LST):30 HOURLY INCREMENTAL PRECIPITATION VALUES (IN):.00 0.00 0.00 0.00 0.00 0.00 0.00 T    0.06 0.04 0.03 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.03 0.02 0.02EQDR01   1,87AXW093R02   1,87AXW093R03     N7GJS072R04     N7GKS075
```

```
1403725030147322010010104596+40779-073881SOM  +0009KLGA V030999999999999999999999999999+99999+99999999999ADDAB1017289UAD10041790909999999995AE1115115065025AH1005002592701515AH2010003092701565AH3015003092701565AH4020003892702065AH5030005190909545AH6045007190910045AI1060008990300265AI2080011290910105AI3100013590910105AI4120016390909525AI5150020190910045AI6180023190910045AK102283219999AAM101629191999999999UAN1744026795KB1744N-00505KB2744M+05895KB3744A+02725KC1N9-00832918995KC2M9+01880399995KD1744H08645KD2744C00005KE1065005165005MH110163U10176UMK110342121750U09885091651UREMSOM891PCP MTOT:6.81 DEPNRM:+3.3 PCP GT 24HRS:1.64 DATE(S):9 DAYS W/PCP >=.01:11 DAYS W/PCP >=.10:11 DAYS W/ PCP >=.50:6 DAYS W/PCP >=1.00:2 MSDP AMTS W/DATE-TIME TAGS:MIN:5 0.10  27/0151 MIN:10 0.12  27/0156 MIN:15 0.12  27/0156 MIN:20 0.15  27/0206 MIN:30 0.20  09/0954 MIN:45 0.28  09/1004 MIN:60 0.35  03/0026 MIN:80 0.44  09/1010 MIN:100 0.53  09/1010 MIN:120 0.64  09/0952 MIN:150 0.79  09/1004 MIN:180 0.91  09/1004 SN GT DP ON GRND:9 DATE(S):20 21 SN GT IN 24HRS:8.8 DATE(S): 19-20SN MTOT:10.5 AVG DLY MIN:31.1  AVG DLY MAX:42.6  AVG MLY TMP:36.9  DEP NORM:-1.0  MIN TMP:17 DATE(S):29 18 MAX TMP:66  DATE(S):03 DAYS MAX <=32:6 DAYS MAX >=90:0  DAYS MIN <=32:16 DAYS MIN  <=0:0  AVG STP:30.010 LWST SLP:29.18 DATE/TIME:091633 HGST SLP:30.54 DATE/TIME:121750 HDD MTH TOT:864 DEP NORM:+28 SEASON(JUL 1-JUN 30):1515 DEP NORM:-136 CDD MTH TOT:0 DEP NORM: 0 SEASON(JAN 1-DEC 31):1051 DEP NORM:-91EQDR01  6.817ABP070R02     97AKS094
```

The fix can be done in the `Measure` object.

Discussion:

Patch:
diff --git a/isdparser/_version.py b/isdparser/_version.py
index b72bd09..5aa75f8 100644
--- a/isdparser/_version.py
+++ b/isdparser/_version.py
@@ -1,1 +1,1 @@
-VERSION='0.2.1'
\ No newline at end of file
+VERSION='0.2.3'
\ No newline at end of file
diff --git a/isdparser/measures.py b/isdparser/measures.py
index f42a6fe..0434f96 100644
--- a/isdparser/measures.py
+++ b/isdparser/measures.py
@@ -86,7 +86,7 @@ class Measure(object):
         Returns:
             Measure: the instance.
         """
-        self._value = value 
+        self._value = value.strip() if type(value) is str else value
         return self
 
 


Test patch:
diff --git a/tests/test_measures.py b/tests/test_measures.py
index bc73332..5bc33c8 100644
--- a/tests/test_measures.py
+++ b/tests/test_measures.py
@@ -77,6 +77,19 @@ def test_categorical_measure():
 
     tc.assertDictEqual(expected, m.schema())
 
+    test_mapping_with_whitespace = {
+        'blah': 'blah blah blah'
+    }
+
+    m = CategoricalMeasure('my_measure', Position(1,5), test_mapping_with_whitespace, missing='9')
+    m.set_value('blah    ')
+    expected = {
+        'measure': 'my_measure', 
+        'value': 'blah', 
+        'description': 'blah blah blah'
+    }
+    tc.assertDictEqual(expected, m.schema())
+
 
 def test_section(mocker):