apmtools 0.2.1__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: apmtools
3
- Version: 0.2.001
3
+ Version: 0.2.003
4
4
  Summary: A collection of tools for processing air pollution monitoring data
5
5
  Project-URL: Homepage, https://github.com/federlorenz/apmtools
6
6
  Author-email: Federico Lorenzetti <lorenzetti.federico@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "apmtools"
7
- version = "0.2.001"
7
+ version = "0.2.003"
8
8
  authors = [
9
9
  { name="Federico Lorenzetti", email="lorenzetti.federico@gmail.com" },
10
10
  ]
@@ -476,7 +476,7 @@ class Dataset(DictionaryPlus):
476
476
  self.scan_folder(directory=f"{directory}{j}/", levels=levels,
477
477
  level=level+1, monitor=monitor, levels_dict=levels_dict, gmt_timezone_shift=gmt_timezone_shift, interpolate=interpolate, add_m=add_m)
478
478
 
479
- def save_summary(self, save_csv=True, filename="./", columns={}):
479
+ def save_summary(self, save_csv=True, filename="./", columns={}, merged=True):
480
480
  types_in = list(set(type(v) for v in self.values()))
481
481
 
482
482
  def match_class(x):
@@ -699,8 +699,11 @@ class Dataset(DictionaryPlus):
699
699
  with open(f"{z[0]+"_"+filename if filename != "./" else z[0]+".csv"}", "w", encoding="utf-8") as output:
700
700
  z[1].to_csv(output, index=False)
701
701
  out[z[0]] = z[1]
702
+ if merged:
703
+ return pd.concat([out[k] for k in out.keys()]).reset_index()
702
704
  return out
703
705
 
706
+
704
707
  def save_data(self, directory="./saved/", levels=[]):
705
708
  def get_specific_level(v, j):
706
709
  if hasattr(v, j):
@@ -837,7 +840,7 @@ class Dataset(DictionaryPlus):
837
840
  if (k in value.m.keys()) and (value.m[k] == v):
838
841
  value.m[k] = None
839
842
 
840
- def monitor(self,value):
843
+ def get_monitor(self,value):
841
844
  return self.subset({"monitor":[value]})
842
845
 
843
846
  class Group(pd.DataFrame):
@@ -1397,6 +1400,9 @@ class Summary(pd.DataFrame):
1397
1400
 
1398
1401
  return output
1399
1402
 
1403
+ def get_monitor(self, value):
1404
+ return self.subset({"monitor": [value]})
1405
+
1400
1406
  def plot_app(
1401
1407
  self,
1402
1408
  x=None,
@@ -1775,6 +1781,10 @@ class Upas(Apm):
1775
1781
  def _constructor_sliced(self):
1776
1782
  return UpasSeries
1777
1783
 
1784
+ @property
1785
+ def units(self):
1786
+ return upas_units
1787
+
1778
1788
  class UpasSeries(ApmSeries):
1779
1789
  def __init__(self, *args, **kwargs):
1780
1790
  ApmSeries.__init__(self, *args, **kwargs)
@@ -1801,6 +1811,10 @@ class Lascar(Apm):
1801
1811
  def _constructor_sliced(self):
1802
1812
  return LascarSeries
1803
1813
 
1814
+ @property
1815
+ def units(self):
1816
+ return lascar_units
1817
+
1804
1818
  class LascarSeries(ApmSeries):
1805
1819
  def __init__(self, *args, **kwargs):
1806
1820
  ApmSeries.__init__(self, *args, **kwargs)
@@ -1826,6 +1840,10 @@ class Purple(Apm):
1826
1840
  def _constructor_sliced(self):
1827
1841
  return PurpleSeries
1828
1842
 
1843
+ @property
1844
+ def units(self):
1845
+ return purple_units
1846
+
1829
1847
  class PurpleSeries(ApmSeries):
1830
1848
  def __init__(self, *args, **kwargs):
1831
1849
  ApmSeries.__init__(self, *args, **kwargs)
File without changes
File without changes
File without changes
File without changes