kinverarity1 / python-sa-gwdata

Python package for the Groundwater Data section of the DEW WaterConnect website
https://python-sa-gwdata.readthedocs.io/en/latest/index.html
MIT License
3 stars 0 forks source link

Bug: "can't set attribute" #15

Closed kinverarity1 closed 4 years ago

kinverarity1 commented 4 years ago
AttributeError                            Traceback (most recent call last)
<ipython-input-5-ade1c9c139c9> in <module>
      1 wls = (
----> 2     db.water_levels(db.find_wells(well_id))
      3     .pipe(wrap_technote.filter_wl_observations)
      4 )
      5 wls.info()

c:\devapps\projects\dew_gwdata\dew_gwdata\_sageodata.py in find_wells(self, input_text, **kwargs)
    239         logger.debug("unit_nos -> {}".format(r_unit_nos))
    240         all_dh_nos = list(set(dh_nos + r_obs_nos + r_unit_nos))
--> 241         return self._create_well_instances(all_dh_nos)
    242 
    243 

c:\devapps\projects\dew_gwdata\dew_gwdata\_sageodata.py in _create_well_instances(self, dh_nos)
    198         df["name"] = df["dh_name"]
    199         df["unit_no.hyphen"] = df["unit_hyphen"]
--> 200         return Wells([Well(**vals.to_dict()) for _, vals in df.iterrows()])
    201 
    202     def find_wells(self, input_text, **kwargs):

c:\devapps\projects\dew_gwdata\dew_gwdata\_sageodata.py in <listcomp>(.0)
    198         df["name"] = df["dh_name"]
    199         df["unit_no.hyphen"] = df["unit_hyphen"]
--> 200         return Wells([Well(**vals.to_dict()) for _, vals in df.iterrows()])
    201 
    202     def find_wells(self, input_text, **kwargs):

c:\devapps\projects\python-sa-gwdata\sa_gwdata\identifiers.py in __init__(self, *args, **kwargs)
    270         self.obs_no = ObsNo()
    271         self.name = ""
--> 272         self.set(*args, **kwargs)
    273 
    274     def set(self, dh_no, unit_no="", obs_no="", **kwargs):

c:\devapps\projects\python-sa-gwdata\sa_gwdata\identifiers.py in set(self, dh_no, unit_no, obs_no, **kwargs)
    278         self.set_obs_no(obs_no)
    279         for key, value in kwargs.items():
--> 280             self.set_well_attribute(key, value)
    281 
    282     def set_well_attribute(self, key, value):

c:\devapps\projects\python-sa-gwdata\sa_gwdata\identifiers.py in set_well_attribute(self, key, value)
    283         key = key.lower()
    284         self._attributes.append(key)
--> 285         setattr(self, key, value)
    286 
    287     def set_obs_no(self, *args):

AttributeError: can't set attribute