diff --git a/tests-dir/pytestcases/test_1_reconstructions.py b/tests-dir/pytestcases/test_1_reconstructions.py index 160a6502..0ebb7c56 100644 --- a/tests-dir/pytestcases/test_1_reconstructions.py +++ b/tests-dir/pytestcases/test_1_reconstructions.py @@ -163,7 +163,7 @@ def test_cont_arc_length(time, model, muller_2019_model): # Check arc length approximately matches precomputed value cmp = approx_lengths[time] diff = np.abs(total_cont_arc_length - cmp) - assert diff <= 1000.0, err_msg + assert diff <= 3000.0, err_msg else: # Value for this time has not been computed, so just make sure no # errors were encountered @@ -198,10 +198,9 @@ def test_rotation_model_copy(model): def test_reconstruction_filenames(model): - assert ( - "Muller_etal_2019_PlateBoundaries_DeformingNetworks.gpmlz" - in [os.path.basename(i) for i in model.topology_features.filenames] - ) + assert "Muller_etal_2019_PlateBoundaries_DeformingNetworks.gpmlz" in [ + os.path.basename(i) for i in model.topology_features.filenames + ] def test_pickle_reconstruction(model): diff --git a/tests-dir/pytestcases/test_2_points.py b/tests-dir/pytestcases/test_2_points.py index d5ae3641..4b97e2cc 100644 --- a/tests-dir/pytestcases/test_2_points.py +++ b/tests-dir/pytestcases/test_2_points.py @@ -24,25 +24,37 @@ """ + # TESTING THE POINTS OBJECT @pytest.mark.parametrize("time", reconstruction_times) def test_point_reconstruction(time, gpts): rlons, rlats = gpts.reconstruct(time, return_array=True, anchor_plate_id=0) - assert (rlons, rlats), "Unable to reconstruct point data to {} Ma with Muller et al. (2019).".format(time) + assert ( + rlons and rlats + ), "Unable to reconstruct point data to {} Ma with Muller et al. (2019).".format( + time + ) + - # TESTING PLATE VELOCITY CALCULATIONS @pytest.mark.parametrize("time", reconstruction_times) def test_plate_velocity(time, gpts): plate_vel = gpts.plate_velocity(time, delta_time=1) - assert plate_vel, "Unable to calculate plate velocities of point data at {} Ma with Muller et al. (2019).".format(time) + assert ( + plate_vel + ), "Unable to calculate plate velocities of point data at {} Ma with Muller et al. (2019).".format( + time + ) + def test_point_attributes(gpts): attr = np.arange(0, gpts.size) gpts.add_attributes(FROMAGE=attr, TOAGE=attr) + def test_pickle_Points(gpts): import pickle + gpts_dump = pickle.dumps(gpts) gpts_load = pickle.loads(gpts_dump) @@ -51,5 +63,8 @@ def test_pickle_Points(gpts): gpts_dump = pickle.dumps(gpts) gpts_load = pickle.loads(gpts_dump) + def test_change_ancbor_plate(gpts): - gpts.rotate_reference_frames(50, from_rotation_reference_plate=0, to_rotation_reference_plate=101) + gpts.rotate_reference_frames( + 50, from_rotation_reference_plate=0, to_rotation_reference_plate=101 + )