Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions autofit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
from .text import formatter
from .text import samples_text
from .visualise import VisualiseGraph
from .graph_spec import GraphSpec, graph_spec_from
from .interpolator import (
LinearInterpolator,
SplineInterpolator,
Expand Down
2,030 changes: 2,030 additions & 0 deletions autofit/graph_spec.py

Large diffs are not rendered by default.

Empty file.
33 changes: 33 additions & 0 deletions test_autofit/graph_spec/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import itertools

import pytest

import autofit as af


@pytest.fixture(autouse=True)
def reset_ids():
"""
Model object and prior ids are global counters, and the spec records both.
Reset them before every test so ids -- and therefore the serialised spec --
are a function of the model alone (copied from ``test_autofit/test_visualise.py``).
"""
af.ModelObject._ids = itertools.count()
af.Prior._ids = itertools.count()


class NullAnalysis(af.Analysis):
"""The smallest possible analysis: enough to build an ``af.AnalysisFactor``."""

def log_likelihood_function(self, instance):
return 0.0


class FwhmLatent(af.Analysis.Latent):
@staticmethod
def keys(analysis):
return ["gaussian.fwhm"]


class LatentAnalysis(NullAnalysis):
Latent = FwhmLatent
Loading
Loading