Skip to content

Commit

Permalink
apparently some numpy's still don't have float64, remove test excepti…
Browse files Browse the repository at this point in the history
…ons for Py2
  • Loading branch information
newville committed Apr 30, 2023
1 parent 2f00509 commit 9cfb293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions tests/test_ampgo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for the AMPGO global minimization algorithm."""
import sys

import numpy as np
from numpy.testing import assert_allclose
Expand Down Expand Up @@ -100,8 +99,6 @@ def test_ampgo_invalid_tabustrategy(minimizer_Alpine02):
minimizer_Alpine02.minimize(method='ampgo', **kws)


@pytest.mark.skipif(sys.version_info.major == 2,
reason="does not throw an exception in Python 2")
def test_ampgo_local_opts(minimizer_Alpine02):
"""Test AMPGO algorithm, pass local_opts to solver."""
# use local_opts to pass maxfun to the local optimizer: providing a string
Expand Down
8 changes: 4 additions & 4 deletions tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for the Model, CompositeModel, and ModelResult classes."""

import functools
import sys
import unittest
import warnings

Expand Down Expand Up @@ -1263,8 +1262,6 @@ def double_exp(x, a1, t1, a2, t2):
msg = 'The model function generated NaN values and the fit aborted!'
self.assertRaisesRegex(ValueError, msg, result)

@pytest.mark.skipif(sys.version_info.major == 2,
reason="cannot use wrapped functions with Python 2")
def test_wrapped_model_func(self):
x = np.linspace(-1, 1, 51)
y = 2.0*x + 3 + 0.0003 * x*x
Expand Down Expand Up @@ -1415,8 +1412,11 @@ def test_make_params_valuetypes():

val_i32 = np.arange(10, dtype=np.int32)
val_i64 = np.arange(10, dtype=np.int64)
val_f128 = np.arange(10, dtype=np.float128)/3.0
val_c128 = np.arange(10, dtype=np.complex128)/3.0
try:
val_f128 = np.arange(10, dtype=np.float128)/3.0
except AttributeError:
val_f128 = np.arange(10, dtype=np.float64)/3.0

pars = mod.make_params(amplitude=val_i64[2],
frequency=val_i32[3],
Expand Down

0 comments on commit 9cfb293

Please sign in to comment.