Skip to content

Commit

Permalink
Renamed function to change point tests. Closes #1391.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClerx committed Aug 17, 2021
1 parent e89e2ba commit 4d757a3
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 113 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#
# "Functional test" module for PINTS.
# Change point tests for PINTS.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#

# Import all problem classes straight into this module, so that they can be
# addressed as e.g. pints.functionaltests.RunMcmcMethodOnAnnulus.
# addressed as e.g. pints.cptests.RunMcmcMethodOnAnnulus.
from ._problems import ( # noqa
RunMcmcMethodOnAnnulus,
RunMcmcMethodOnBanana,
Expand All @@ -20,7 +20,7 @@

# Import all test modules (not methods!) directly into this method, so that
# they can be addressed as e.g.
# pints.functionaltests.dram_acmc.two_dim_gaussian().
# pints.cptests.dram_acmc.two_dim_gaussian().
from . import ( # noqa
differential_evolution_mcmc,
dram_acmc,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#
# Functional test discovery methods for PINTS.
# Change point test discovery methods for PINTS.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import inspect

import pints.functionaltests as ft
import pints.cptests as ft


def tests(method=None):
"""
Returns a list of all functional tests, each represented as a tuple
Returns a list of all change point tests, each represented as a tuple
``(method, test)`` where ``method`` is the PINTS class being tested and
``test`` is a callable that returns the test results.
Expand All @@ -28,7 +28,7 @@ def tests(method=None):
for module in modules:
try:
m_method = module._method
m_tests = module._functional_tests
m_tests = module._change_point_tests
except AttributeError:
continue

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Shared problems used in functional testing.
# Shared problems used in change point testing.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
#
# Functional tests for DifferentialEvolutionMCMC
# Change point tests for DifferentialEvolutionMCMC
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.functionaltests as ft
import pints.cptests as ft


def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
Expand All @@ -17,7 +17,7 @@ def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnTwoDimGaussian`.
:class:`pints.cptests.RunMcmcMethodOnTwoDimGaussian`.
"""
problem = ft.RunMcmcMethodOnTwoDimGaussian(
_method, 10, n_iterations, n_warmup)
Expand All @@ -34,7 +34,7 @@ def banana(n_iterations=5000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnBanana`.
:class:`pints.cptests.RunMcmcMethodOnBanana`.
"""
problem = ft.RunMcmcMethodOnBanana(
_method, 20, n_iterations, n_warmup)
Expand All @@ -52,7 +52,7 @@ def correlated_gaussian(n_iterations=10000, n_warmup=1000):
``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCorrelatedGaussian`.
:class:`pints.cptests.RunMcmcMethodOnCorrelatedGaussian`.
"""
problem = ft.RunMcmcMethodOnCorrelatedGaussian(
_method, 20, n_iterations, n_warmup)
Expand All @@ -69,7 +69,7 @@ def annulus(n_iterations=10000, n_warmup=1000):
dictionary with entries ``distance`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnAnnulus`.
:class:`pints.cptests.RunMcmcMethodOnAnnulus`.
"""
problem = ft.RunMcmcMethodOnAnnulus(
_method, 10, n_iterations, n_warmup)
Expand All @@ -80,7 +80,7 @@ def annulus(n_iterations=10000, n_warmup=1000):


_method = pints.DifferentialEvolutionMCMC
_functional_tests = [
_change_point_tests = [
annulus,
banana,
correlated_gaussian,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
#
# Functional tests for DramACMC
# Change point tests for DramACMC
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.functionaltests as ft
import pints.cptests as ft


def two_dim_gaussian(n_iterations=8000, n_warmup=2000):
Expand All @@ -17,7 +17,7 @@ def two_dim_gaussian(n_iterations=8000, n_warmup=2000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnTwoDimGaussian`.
:class:`pints.cptests.RunMcmcMethodOnTwoDimGaussian`.
"""
problem = ft.RunMcmcMethodOnTwoDimGaussian(
_method, 4, n_iterations, n_warmup)
Expand All @@ -34,7 +34,7 @@ def banana(n_iterations=4000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnBanana`.
:class:`pints.cptests.RunMcmcMethodOnBanana`.
"""
problem = ft.RunMcmcMethodOnBanana(
_method, 4, n_iterations, n_warmup)
Expand All @@ -52,7 +52,7 @@ def correlated_gaussian(n_iterations=8000, n_warmup=4000):
``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCorrelatedGaussian`.
:class:`pints.cptests.RunMcmcMethodOnCorrelatedGaussian`.
"""
problem = ft.RunMcmcMethodOnCorrelatedGaussian(
_method, 4, n_iterations, n_warmup)
Expand All @@ -63,7 +63,7 @@ def correlated_gaussian(n_iterations=8000, n_warmup=4000):


_method = pints.DramACMC
_functional_tests = [
_change_point_tests = [
banana,
correlated_gaussian,
two_dim_gaussian,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
#
# Functional tests for DreamMCMC
# Change point tests for DreamMCMC
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.functionaltests as ft
import pints.cptests as ft


def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
Expand All @@ -17,7 +17,7 @@ def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnTwoDimGaussian`.
:class:`pints.cptests.RunMcmcMethodOnTwoDimGaussian`.
"""
problem = ft.RunMcmcMethodOnTwoDimGaussian(
_method, 10, n_iterations, n_warmup)
Expand All @@ -35,7 +35,7 @@ def banana(n_iterations=5000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnBanana`.
:class:`pints.cptests.RunMcmcMethodOnBanana`.
"""
problem = ft.RunMcmcMethodOnBanana(
_method, 20, n_iterations, n_warmup)
Expand All @@ -53,7 +53,7 @@ def correlated_gaussian(n_iterations=10000, n_warmup=1000):
``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCorrelatedGaussian`.
:class:`pints.cptests.RunMcmcMethodOnCorrelatedGaussian`.
"""
problem = ft.RunMcmcMethodOnCorrelatedGaussian(
_method, 20, n_iterations, n_warmup)
Expand All @@ -70,7 +70,7 @@ def annulus(n_iterations=10000, n_warmup=1000):
dictionary with entries ``distance`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnAnnulus`.
:class:`pints.cptests.RunMcmcMethodOnAnnulus`.
"""
problem = ft.RunMcmcMethodOnAnnulus(
_method, 10, n_iterations, n_warmup)
Expand All @@ -81,7 +81,7 @@ def annulus(n_iterations=10000, n_warmup=1000):


_method = pints.DreamMCMC
_functional_tests = [
_change_point_tests = [
annulus,
banana,
correlated_gaussian,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
#
# Functional tests for EmceeHammerMCMC
# Change point tests for EmceeHammerMCMC
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.functionaltests as ft
import pints.cptests as ft


def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
Expand All @@ -17,7 +17,7 @@ def two_dim_gaussian(n_iterations=10000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnTwoDimGaussian`.
:class:`pints.cptests.RunMcmcMethodOnTwoDimGaussian`.
"""
problem = ft.RunMcmcMethodOnTwoDimGaussian(
_method, 10, n_iterations, n_warmup)
Expand All @@ -34,7 +34,7 @@ def banana(n_iterations=10000, n_warmup=2000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnBanana`.
:class:`pints.cptests.RunMcmcMethodOnBanana`.
"""
problem = ft.RunMcmcMethodOnBanana(
_method, 10, n_iterations, n_warmup)
Expand All @@ -52,7 +52,7 @@ def correlated_gaussian(n_iterations=8000, n_warmup=4000):
``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCorrelatedGaussian`.
:class:`pints.cptests.RunMcmcMethodOnCorrelatedGaussian`.
"""
problem = ft.RunMcmcMethodOnCorrelatedGaussian(
_method, 10, n_iterations, n_warmup)
Expand All @@ -69,7 +69,7 @@ def annulus(n_iterations=4000, n_warmup=2000):
dictionary with entries ``distance`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnAnnulus`.
:class:`pints.cptests.RunMcmcMethodOnAnnulus`.
"""
problem = ft.RunMcmcMethodOnAnnulus(
_method, 10, n_iterations, n_warmup)
Expand All @@ -87,7 +87,7 @@ def multimodal_gaussian(n_iterations=10000, n_warmup=1000):
"kld" and "mean-ess".
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnMultimodalGaussian`.
:class:`pints.cptests.RunMcmcMethodOnMultimodalGaussian`.
"""
problem = ft.RunMcmcMethodOnMultimodalGaussian(
_method, 10, n_iterations, n_warmup)
Expand All @@ -104,7 +104,7 @@ def cone(n_iterations=10000, n_warmup=1000):
a dict with entries "distance" and "mean-ess".
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCone`.
:class:`pints.cptests.RunMcmcMethodOnCone`.
"""
problem = ft.RunMcmcMethodOnCone(
_method, 10, n_iterations, n_warmup)
Expand All @@ -115,7 +115,7 @@ def cone(n_iterations=10000, n_warmup=1000):


_method = pints.EmceeHammerMCMC
_functional_tests = [
_change_point_tests = [
annulus,
banana,
cone,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
#
# Functional tests for HaarioACMC
# Change point tests for HaarioACMC
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.functionaltests as ft
import pints.cptests as ft


def two_dim_gaussian(n_iterations=4000, n_warmup=1000):
Expand All @@ -17,7 +17,7 @@ def two_dim_gaussian(n_iterations=4000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnTwoDimGaussian`.
:class:`pints.cptests.RunMcmcMethodOnTwoDimGaussian`.
"""
problem = ft.RunMcmcMethodOnTwoDimGaussian(
_method, 4, n_iterations, n_warmup)
Expand All @@ -34,7 +34,7 @@ def banana(n_iterations=4000, n_warmup=1000):
``[0, 0]`` and returns a dictionary with entries ``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnBanana`.
:class:`pints.cptests.RunMcmcMethodOnBanana`.
"""
problem = ft.RunMcmcMethodOnBanana(
_method, 4, n_iterations, n_warmup)
Expand All @@ -52,7 +52,7 @@ def correlated_gaussian(n_iterations=8000, n_warmup=4000):
``kld`` and ``mean-ess``.
For details of the solved problem, see
:class:`pints.functionaltests.RunMcmcMethodOnCorrelatedGaussian`.
:class:`pints.cptests.RunMcmcMethodOnCorrelatedGaussian`.
"""
problem = ft.RunMcmcMethodOnCorrelatedGaussian(
_method, 4, n_iterations, n_warmup)
Expand All @@ -63,7 +63,7 @@ def correlated_gaussian(n_iterations=8000, n_warmup=4000):


_method = pints.HaarioACMC
_functional_tests = [
_change_point_tests = [
banana,
correlated_gaussian,
two_dim_gaussian,
Expand Down
Loading

0 comments on commit 4d757a3

Please sign in to comment.