Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisblake committed Aug 1, 2023
1 parent 6ce961f commit a68b443
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pyaerocom/aeroval/fairmode_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _RMSU(mean: float, std: float, spec: str) -> float:
RV = SPECIES[spec]["RV"]
alpha = SPECIES[spec]["alpha"]

in_sqrt = (1 - alpha**2) * (mean**2 + std**2) + alpha**2 * RV**2
in_sqrt = (1 - alpha ** 2) * (mean ** 2 + std ** 2) + alpha ** 2 * RV ** 2

return UrRV * np.sqrt(in_sqrt)

Expand All @@ -44,7 +44,7 @@ def _fairmode_sign(mod_std: float, obs_std: float, R: float) -> float:

def _crms(mod_std: float, obs_std: float, R: float) -> float:
"""Returns the Centered Root Mean Squared Error"""
return np.sqrt(mod_std**2 + obs_std**2 - 2 * mod_std * obs_std * R)
return np.sqrt(mod_std ** 2 + obs_std ** 2 - 2 * mod_std * obs_std * R)


def _mqi(rms: float, rmsu: float, *, beta: float) -> float:
Expand Down
8 changes: 4 additions & 4 deletions pyaerocom/io/helpers_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def unitconv_sfc_conc_bck(data, x=2):

mmO = 15.9999 # molar mass oxygen
mmS = 32.065 # molar mass sulphur
mm_compound = (mmS + x * mmO) * 10**3 # *10**3 gives molar mass in micrograms
mm_compound = (mmS + x * mmO) * 10 ** 3 # *10**3 gives molar mass in micrograms

nr_molecules = mass_to_nr_molecules(data, mm_compound)
weight_s = nr_molecules_to_mass(nr_molecules, mmS * 10**3) # weigth in ug
weight_s = nr_molecules_to_mass(nr_molecules, mmS * 10 ** 3) # weigth in ug
return weight_s


Expand All @@ -94,8 +94,8 @@ def unitconv_sfc_conc(data, nr_of_O=2):
"""

mm_s = 32.065 * 10**6 # in units of ug/mol
mm_o = nr_of_O * 15.9999 * 10**6 ## in units of ug/mol
mm_s = 32.065 * 10 ** 6 # in units of ug/mol
mm_o = nr_of_O * 15.9999 * 10 ** 6 ## in units of ug/mol
nr_molecules = mass_to_nr_molecules(data, mm_s) # 32.065*10**6) [ug/mol]
added_weight_oksygen = nr_molecules_to_mass(nr_molecules, mm_o) # ug
# added weights in micrograms
Expand Down
2 changes: 1 addition & 1 deletion pyaerocom/mathutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def calc_statistics(data, ref_data, lowlim=None, highlim=None, min_num_valid=1,

difference = data - ref_data

diffsquare = difference**2
diffsquare = difference ** 2

if weights is not None:
weights = weights[mask]
Expand Down
2 changes: 1 addition & 1 deletion pyaerocom/plot/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def plot_griddeddata_on_map(
if discrete_norm:
# to compute upper range of colour range, round up vmax
exp = float(exponent(vmax) - 1)
vmax_colors = ceil(vmax / 10**exp) * 10**exp
vmax_colors = ceil(vmax / 10 ** exp) * 10 ** exp
bounds = calc_pseudolog_cmaplevels(vmin=vmin, vmax=vmax_colors, add_zero=add_zero)
norm = BoundaryNorm(boundaries=bounds, ncolors=cmap.N, clip=False)

Expand Down
4 changes: 2 additions & 2 deletions pyaerocom/trends_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def _compute_trend_error(m, m_err, v0, v0_err):
"""

delta_sl = m_err / v0
delta_ref = m * v0_err / v0**2
return np.sqrt(delta_sl**2 + delta_ref**2) * 100
delta_ref = m * v0_err / v0 ** 2
return np.sqrt(delta_sl ** 2 + delta_ref ** 2) * 100


def _get_season(mon):
Expand Down
6 changes: 3 additions & 3 deletions pyaerocom/ungriddeddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2183,21 +2183,21 @@ def code_lat_lon_in_float(self):
# multiply lons with 10 ** (three times the needed) precision and add the lats muliplied with 1E(precision) to it
self.coded_loc = self._data[:, self._LONINDEX] * 10 ** (3 * self._LOCATION_PRECISION) + (
self._data[:, self._LATINDEX] + self._LAT_OFFSET
) * (10**self._LOCATION_PRECISION)
) * (10 ** self._LOCATION_PRECISION)
return self.coded_loc

def decode_lat_lon_from_float(self):
"""method to decode lat and lon from a single number calculated by code_lat_lon_in_float"""

lons = (
np.trunc(self.coded_loc / 10 ** (2 * self._LOCATION_PRECISION))
/ 10**self._LOCATION_PRECISION
/ 10 ** self._LOCATION_PRECISION
)
lats = (
self.coded_loc
- np.trunc(self.coded_loc / 10 ** (2 * self._LOCATION_PRECISION))
* 10 ** (2 * self._LOCATION_PRECISION)
) / (10**self._LOCATION_PRECISION) - self._LAT_OFFSET
) / (10 ** self._LOCATION_PRECISION) - self._LAT_OFFSET

return lats, lons

Expand Down

0 comments on commit a68b443

Please sign in to comment.