pycoustic 0.1.7__tar.gz → 0.1.9__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,11 +1,13 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pycoustic
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary:
5
5
  Author: thumpercastle
6
6
  Author-email: tony.ryb@gmail.com
7
- Requires-Python: >=3.11.9,<4.0
7
+ Requires-Python: >=3.10,<=3.13
8
8
  Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
9
11
  Classifier: Programming Language :: Python :: 3.12
10
12
  Classifier: Programming Language :: Python :: 3.13
11
13
  Requires-Dist: numpy (==2.2.6)
@@ -6,13 +6,21 @@ import datetime as dt
6
6
 
7
7
  class Log:
8
8
  def __init__(self, path=""):
9
+ #TODO C:\Users\tonyr\PycharmProjects\pycoustic\.venv2\Lib\site-packages\pycoustic\log.py:15: UserWarning:
10
+ #Parsing dates in %Y/%m/%d %H:%M format when dayfirst=True was specified. Pass `dayfirst=False` or specify a format to silence this warning.
9
11
  """
10
12
  The Log class is used to store the measured noise data from one data logger.
11
13
  The data must be entered in a .csv file with headings in the specific format "Leq A", "L90 125" etc.
12
14
  :param path: the file path for the .csv noise data
13
15
  """
14
16
  self._filepath = path
15
- self._master = pd.read_csv(path, index_col="Time", parse_dates=["Time"], dayfirst=True)
17
+ self._master = pd.read_csv(
18
+ path,
19
+ index_col="Time",
20
+ parse_dates=["Time"],
21
+ date_format="%Y/%m/%d %H:%M", # Explicit format to avoid the dayfirst warning
22
+ # dayfirst=False, # Optional: include for clarity; default is False
23
+ )
16
24
  self._master.index = pd.to_datetime(self._master.index)
17
25
  self._master = self._master.sort_index(axis=1)
18
26
  self._start = self._master.index.min()
@@ -175,8 +183,8 @@ class Log:
175
183
  if isinstance(df, pd.Series):
176
184
  df = pd.DataFrame(data=df)
177
185
  return df.set_index(idx, inplace=False)
178
-
179
- def _get_period(self, data=None, period="days", night_idx=True):
186
+ #test
187
+ def get_period(self, data=None, period="days", night_idx=True):
180
188
  """
181
189
  Private method to get data for daytime, evening or night-time periods.
182
190
  :param data: Input data, usually master
@@ -196,7 +204,7 @@ class Log:
196
204
  data = self._return_as_night_idx(data=data)
197
205
  return data.between_time(self._night_start, self._day_start, inclusive="left")
198
206
 
199
- def _leq_by_date(self, data, cols=None):
207
+ def leq_by_date(self, data, cols=None):
200
208
  """
201
209
  Private method to undertake Leq calculations organised by date. For contiguous night-time periods crossing
202
210
  over midnight (e.g. from 23:00 to 07:00), the input data needs to have a night-time index.
@@ -341,6 +349,9 @@ class Log:
341
349
  self._master = self._append_night_idx(data=self._master)
342
350
  self._antilogs = self._append_night_idx(data=self._antilogs)
343
351
 
352
+ #C:\Users\tonyr\PycharmProjects\pycoustic\.venv2\Lib\site-packages\pycoustic\log.py:339: PerformanceWarning:
353
+ #dropping on a non-lexsorted multi-index without a level parameter may impact performance.
354
+
344
355
  def get_period_times(self):
345
356
  """
346
357
  :return: the tuples of period start times.