Commit d4d2e00b authored by Jenni Rinker's avatar Jenni Rinker
Browse files

typos and linting

parent cce008fd
Pipeline #20539 passed with stage
in 1 minute and 37 seconds
...@@ -22,7 +22,8 @@ from pyconturb._utils import (combine_spat_con, _spat_rownames, _DEF_KWARGS, ...@@ -22,7 +22,8 @@ from pyconturb._utils import (combine_spat_con, _spat_rownames, _DEF_KWARGS,
def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec', def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec',
wsp_func=None, sig_func=None, spec_func=None, wsp_func=None, sig_func=None, spec_func=None,
interp_data='none', seed=None, nf_chunk=1, dtype=np.float64, verbose=False, **kwargs): interp_data='none', seed=None, nf_chunk=1, dtype=np.float64, verbose=False,
**kwargs):
"""Generate a turbulence box (constrained or unconstrained). """Generate a turbulence box (constrained or unconstrained).
Parameters Parameters
...@@ -67,7 +68,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec', ...@@ -67,7 +68,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec',
Print extra information during turbulence generation. Default is False. Print extra information during turbulence generation. Default is False.
dtype : data type, optional dtype : data type, optional
Change precision of calculation (np.float32 or np.float64). Will reduce the Change precision of calculation (np.float32 or np.float64). Will reduce the
storage, and might slightly reduce the computational time. Default is np.float64 storage, and might slightly reduce the computational time. Default is np.float64.
**kwargs **kwargs
Optional keyword arguments to be fed into the Optional keyword arguments to be fed into the
spectral/turbulence/profile/etc. models. spectral/turbulence/profile/etc. models.
...@@ -93,7 +94,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec', ...@@ -93,7 +94,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec',
+ 'Nothing to simulate.') + 'Nothing to simulate.')
return None return None
dtype_complex=np.complex64 if dtype==np.float32 else np.complex128 dtype_complex=np.complex64 if dtype==np.float32 else np.complex128 # complex dtype
# add T, dt, con_tc to kwargs # add T, dt, con_tc to kwargs
kwargs = {**_DEF_KWARGS, **kwargs, 'T': T, 'dt': dt, 'con_tc': con_tc} kwargs = {**_DEF_KWARGS, **kwargs, 'T': T, 'dt': dt, 'con_tc': con_tc}
...@@ -133,7 +134,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec', ...@@ -133,7 +134,7 @@ def gen_turb(spat_df, T=600, dt=1, con_tc=None, coh_model='iec',
all_mags = np.concatenate((con_mags, sim_mags), axis=1) # con and sim all_mags = np.concatenate((con_mags, sim_mags), axis=1) # con and sim
else: else:
all_mags = sim_mags # just sim all_mags = sim_mags # just sim
all_mags=all_mags.astype(dtype, copy=False) all_mags = all_mags.astype(dtype, copy=False)
# get uncorrelated phasors for simulation # get uncorrelated phasors for simulation
np.random.seed(seed=seed) # initialize random number generator np.random.seed(seed=seed) # initialize random number generator
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment