pthelma 1.0.0__cp310-cp310-musllinux_1_2_x86_64.whl → 2.0.0__cp310-cp310-musllinux_1_2_x86_64.whl

Sign up to get free protection for your applications and to get access to all the features.
enhydris_cache/cli.py CHANGED
@@ -2,7 +2,6 @@ import configparser
2
2
  import datetime as dt
3
3
  import logging
4
4
  import os
5
- import sys
6
5
  import traceback
7
6
 
8
7
  import click
@@ -81,7 +80,6 @@ class AppConfig:
81
80
  try:
82
81
  self._parse_config()
83
82
  except (OSError, configparser.Error) as e:
84
- sys.stderr.write(str(e))
85
83
  raise click.ClickException(str(e))
86
84
 
87
85
  def _parse_config(self):
evaporation/cli.py CHANGED
@@ -2,7 +2,6 @@ import configparser
2
2
  import datetime as dt
3
3
  import logging
4
4
  import os
5
- import sys
6
5
  import traceback
7
6
  from glob import glob
8
7
  from io import StringIO
@@ -100,7 +99,6 @@ class AppConfig:
100
99
  try:
101
100
  self._parse_config()
102
101
  except (OSError, configparser.Error) as e:
103
- sys.stderr.write(str(e))
104
102
  raise click.ClickException(str(e))
105
103
 
106
104
  def _parse_config(self):
@@ -155,10 +153,10 @@ class AppConfig:
155
153
  self.time_step = s
156
154
 
157
155
  def _check_time_step(self, s):
158
- if s not in ("D", "H"):
156
+ if s not in ("D", "h"):
159
157
  raise WrongValueError(
160
158
  '"{}" is not an appropriate time step; in this version of '
161
- "vaporize, the step must be either D or H.".format(s)
159
+ "vaporize, the step must be either D or h.".format(s)
162
160
  )
163
161
 
164
162
  def _parse_unit_converters(self):
@@ -412,11 +410,11 @@ class ProcessAtPoint:
412
410
  self.pet.unit = "mm"
413
411
  self.pet.timezone = self.timezone
414
412
  self.pet.variable = "Potential Evapotranspiration"
415
- self.pet.precision = 2 if self.config.time_step == "H" else 1
413
+ self.pet.precision = 2 if self.config.time_step == "h" else 1
416
414
  self.pet.location = self.location
417
415
 
418
416
  def _determine_variables_to_use_in_calculation(self):
419
- if self.config.time_step == "H":
417
+ if self.config.time_step == "h":
420
418
  vars = ["temperature", "humidity", "wind_speed", "solar_radiation"]
421
419
  if "pressure" in self.input_timeseries:
422
420
  vars.append("pressure")
@@ -571,7 +569,7 @@ class ProcessSpatial:
571
569
  self._read_input_geofile(var, timestamp)
572
570
 
573
571
  def _get_variables(self):
574
- if self.config.time_step == "H":
572
+ if self.config.time_step == "h":
575
573
  return {
576
574
  "temperature",
577
575
  "humidity",
@@ -45,7 +45,7 @@ class PenmanMonteith(object):
45
45
  self.unit_converters = unit_converters
46
46
 
47
47
  def calculate(self, **kwargs):
48
- if self.time_step == "H":
48
+ if self.time_step == "h":
49
49
  return self.calculate_hourly(**kwargs)
50
50
  elif self.time_step == "D":
51
51
  return self.calculate_daily(**kwargs)
haggregate/__init__.py CHANGED
@@ -1,5 +1,2 @@
1
1
  from .haggregate import * # NOQA
2
2
  from .regularize import * # NOQA
3
-
4
- __author__ = """Antonis Christofides"""
5
- __email__ = "antonis@antonischristofides.com"
haggregate/haggregate.py CHANGED
@@ -106,7 +106,7 @@ class SourceTimeseries(HTimeseries):
106
106
  )
107
107
  except ValueError:
108
108
  raise CannotInferFrequency()
109
- first_timestamp = (current_range[0] - pd.Timedelta("1S")).floor(target_step)
109
+ first_timestamp = (current_range[0] - pd.Timedelta("1s")).floor(target_step)
110
110
  end_timestamp = current_range[-1].ceil(target_step)
111
111
  new_range = pd.date_range(first_timestamp, end_timestamp, freq=self.freq)
112
112
  self.data = self.data.reindex(new_range)
@@ -116,8 +116,8 @@ class AggregatedTimeseries(HTimeseries):
116
116
  def set_metadata(self, source_timeseries):
117
117
  for attr in attrs:
118
118
  setattr(self, attr, getattr(source_timeseries, attr, None))
119
- if self.time_step not in ("1H", "1D"):
120
- raise AggregateError("The target step can currently only be 1H or 1D")
119
+ if self.time_step not in ("1h", "1D"):
120
+ raise AggregateError("The target step can currently only be 1h or 1D")
121
121
  if hasattr(source_timeseries, "title"):
122
122
  self.title = "Aggregated " + source_timeseries.title
123
123
  if hasattr(source_timeseries, "comment"):
@@ -140,7 +140,7 @@ class AggregatedTimeseries(HTimeseries):
140
140
 
141
141
 
142
142
  def _get_offset_in_minutes(timestamp_offset):
143
- m = re.match(r"(-?)(\d*)(T|min)$", timestamp_offset)
143
+ m = re.match(r"(-?)(\d*)min$", timestamp_offset)
144
144
  if not m:
145
145
  raise AggregateError(
146
146
  "The target timestamp offset can currently only be a number of minutes "