Some corrections with static analysis

This commit is contained in:
Noe Brucy
2019-11-04 16:23:33 +01:00
committed by Noe Brucy
parent ed55a0cba1
commit 3986b1cdf4
+9 -7
View File
@@ -53,12 +53,14 @@ class BaseProcessor:
"""
__metaclass__ = ABCMeta
log_id = ""
rules = dict()
filename = ""
@abstractmethod
def __init__(self):
self.def_rules()
log_id = ""
def _log(self, string, status=""):
if len(status) > 0:
print(status + ": " + self.log_id + string)
@@ -152,7 +154,7 @@ class PostProcessor(BaseProcessor):
G = 1. # Gravitational constant
def __init__(self, path=None, num=None, path_out=None, filename=None, pp_params=Params()):
def __init__(self, path=None, num=None, path_out=None, pp_params=Params()):
"""
Creates the basic structures needed for the outputs
"""
@@ -336,7 +338,7 @@ class PostProcessor(BaseProcessor):
# Ray tracer for the sound speed
if self.pp_params.pymses.fft:
rt_cs = splatting.SplatterProcessor(self._amr, ro.info, cs_op, surf_qty=False)
rt_cs = splatting.SplatterProcessor(self._amr, self._ro.info, cs_op, surf_qty=False)
else :
rt_cs = raytracing.RayTracer(self._amr, self._ro.info, cs_op)
@@ -347,7 +349,7 @@ class PostProcessor(BaseProcessor):
return map_Q
def _radial_bins(self, ax_los):
def _radial_bins(self, _):
pos_star = self.pp_params.disk.pos_star
im_extent = self.save.root.maps._v_attrs.im_extent
@@ -363,14 +365,14 @@ class PostProcessor(BaseProcessor):
lrad_in = np.log10(bin_in)
lrad_ext = np.log10(bin_out)
rad_bins = np.logspace(lrad_in, lrad_ext, num=nb_bin)
elif binning == 'lin':
elif self.pp_params.disk.binning == 'lin':
rad_bins = np.linspace(bin_in, bin_out, num=nb_bin)
# Add boundaries
rad_bins = np.concatenate(([0.], rad_bins, [rad_of_box]))
return rad_bins
def _rr(self, ax_los):
def _rr(self, _):
im_extent = self.save.root.maps._v_attrs.im_extent
map_size = self.pp_params.out.map_size
pos_star = self.pp_params.disk.pos_star