Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Relax some of test_toformat_model test conditions
and remove unused imports
  • Loading branch information
pllim committed Sep 15, 2022
commit c83652607e9a4be0e5cb945dad7c126828d94448
11 changes: 3 additions & 8 deletions astropy/cosmology/io/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@

# THIRD PARTY
import pytest

import numpy as np

# LOCAL
import astropy.units as u
from astropy import cosmology
from astropy.cosmology import Cosmology, Planck18, realizations
from astropy.cosmology.core import _COSMOLOGY_CLASSES, Parameter
from astropy.cosmology import realizations
from astropy.cosmology.io.model import _CosmologyModel, from_model, to_model
from astropy.cosmology.parameters import available
from astropy.modeling import FittableModel
from astropy.modeling.models import Gaussian1D
from astropy.utils.compat.optional_deps import HAS_SCIPY

Expand Down Expand Up @@ -116,7 +111,7 @@ def test_toformat_model(self, cosmo, to_format, method_name):

got = model(*args)
expected = getattr(cosmo, method_name)(*args)
assert np.all(got == expected)
np.testing.assert_allclose(got, expected)

# vector result
if "scalar" not in method_name:
Expand All @@ -129,7 +124,7 @@ def test_toformat_model(self, cosmo, to_format, method_name):

got = model(*args)
expected = getattr(cosmo, method_name)(*args)
assert np.all(got == expected)
np.testing.assert_allclose(got, expected)

def test_tofromformat_model_instance(self, cosmo_cls, cosmo, method_name,
to_format, from_format):
Expand Down