diff --git a/src/pysimulators/datatypes.py b/src/pysimulators/datatypes.py index 68d85c0..a59f33c 100644 --- a/src/pysimulators/datatypes.py +++ b/src/pysimulators/datatypes.py @@ -109,9 +109,7 @@ def __new__( ndmin=0, comm=None, ): - if isinstance(data, str): - if comm is None: comm = MPI.COMM_SELF @@ -641,7 +639,6 @@ def __new__( ndmin=0, comm=None, ): - # get a new Map instance (or a subclass if subok is True) result = FitsArray.__new__( cls, @@ -660,7 +657,6 @@ def __new__( result = result.view(cls) if isinstance(data, str): - if comm is None: comm = MPI.COMM_SELF @@ -1022,7 +1018,6 @@ def __new__( ndmin=0, comm=None, ): - # get a new Tod instance (or a subclass if subok is True) result = FitsArray.__new__( cls, @@ -1045,7 +1040,6 @@ def __new__( mask = None if mask is None and isinstance(data, str): - if comm is None: comm = MPI.COMM_SELF diff --git a/src/pysimulators/interfaces/madmap1.py b/src/pysimulators/interfaces/madmap1.py index 6734d81..50ec186 100644 --- a/src/pysimulators/interfaces/madmap1.py +++ b/src/pysimulators/interfaces/madmap1.py @@ -43,7 +43,6 @@ def __init__( commin=MPI.COMM_WORLD, commout=MPI.COMM_WORLD, ): - if commin.size > 1 or commout.size > 1: raise NotImplementedError( 'The parallelisation of the TOD is not implemented' diff --git a/src/pysimulators/operators.py b/src/pysimulators/operators.py index 329c325..d075e26 100644 --- a/src/pysimulators/operators.py +++ b/src/pysimulators/operators.py @@ -120,7 +120,6 @@ def block_diagonal(*partition_args, **keywords): def func(cls): @functools.wraps(cls.__init__) def partition_init(self, *args, **keywords): - # get number of blocks through the partitionin keyword n1 = 0 partitionin = None @@ -611,7 +610,6 @@ class ProjectionBaseOperator(Operator): def __init__( self, units=None, derived_units=None, attrin={}, attrout={}, **keywords ): - if units is None: units = ('', '') if derived_units is None: diff --git a/src/pysimulators/quantities.py b/src/pysimulators/quantities.py index 42f89f4..0686e1c 100644 --- a/src/pysimulators/quantities.py +++ b/src/pysimulators/quantities.py @@ -253,7 +253,6 @@ def __new__( subok=False, ndmin=0, ): - data = np.asanyarray(data) if dtype is None and data.dtype.kind == 'i': dtype = float @@ -685,7 +684,6 @@ def SI(self): ffast = Quantity(1.0, '') fslow = Quantity(1.0, '') for key, val in self._unit.items(): - # check if the unit is a local derived unit newfactor, broadcast = _check_du(self, key, val, self.derived_units) diff --git a/tests/packedtables/test_packedtables.py b/tests/packedtables/test_packedtables.py index 69cfcd0..e885551 100644 --- a/tests/packedtables/test_packedtables.py +++ b/tests/packedtables/test_packedtables.py @@ -42,7 +42,6 @@ def test_ndim1(shape): ], ) def test_ndim2(shape, ndim): - layout = PackedTable(shape, ndim=ndim) assert_equal(layout.ndim, ndim) assert_equal(layout.shape, shape) @@ -463,7 +462,6 @@ def test_ordering3(): ], ) def test_ordering4(ordering, expected): - layout = PackedTable((2, 3), ordering=ordering) assert_equal(layout._index, expected) diff --git a/tests/packedtables/test_samplings.py b/tests/packedtables/test_samplings.py index 852937f..626606f 100644 --- a/tests/packedtables/test_samplings.py +++ b/tests/packedtables/test_samplings.py @@ -10,7 +10,6 @@ @pytest.mark.parametrize('fmt', [lambda ra: ((ra,), {}), lambda ra: ((), {'ra': ra})]) @pytest.mark.parametrize('ra', [1.0, (1.0,), [1.0], np.ones(10), np.ones((2, 3))]) def test_coords_ra(fmt, ra): - args, keywords = fmt(ra) if len(args) > 0 and isscalarlike(args[0]): p = SamplingEquatorial(*args, **keywords) diff --git a/tests/test_datatypes.py b/tests/test_datatypes.py index 65ef210..50a803e 100644 --- a/tests/test_datatypes.py +++ b/tests/test_datatypes.py @@ -112,7 +112,6 @@ def test_input3(type_): ], ) def test_view(type_, attrs): - data = np.ones((2, 4)).view(type_) for attr in attrs: assert hasattr(data, attr) diff --git a/tests/test_healpy.py b/tests/test_healpy.py index bc690ba..ab35d79 100644 --- a/tests/test_healpy.py +++ b/tests/test_healpy.py @@ -32,7 +32,6 @@ ) @pytest.mark.parametrize('nest', [False, True]) def test_cartesian_healpix(vec, shape, nest): - c2h = Cartesian2HealpixOperator(NSIDE, nest=nest) h2c = Healpix2CartesianOperator(NSIDE, nest=nest) a = h2c(c2h(vec)) diff --git a/tests/test_operators.py b/tests/test_operators.py index 98268aa..4e72e45 100644 --- a/tests/test_operators.py +++ b/tests/test_operators.py @@ -193,7 +193,6 @@ def ref_blackbody(w, T): def test_blackbody_scalar(): - w = np.arange(90.0, 111) * 1e-6 T = 15.0 flux = ref_blackbody(w, T) / ref_blackbody(100e-6, T)