Skip to content
Snippets Groups Projects
Commit 172a6f73 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rename Py modules -> ba_plot, ba_fitmonitor; rm from __init__

parent 257859d2
Branches
Tags
No related merge requests found
...@@ -80,7 +80,7 @@ class LMFITPlotter: ...@@ -80,7 +80,7 @@ class LMFITPlotter:
""" """
def __init__(self, fit_objective, every_nth=10): def __init__(self, fit_objective, every_nth=10):
self.fit_objective = fit_objective self.fit_objective = fit_objective
self.plotter_gisas = ba.fit_monitor.PlotterGISAS() self.plotter_gisas = ba_fitmonitor.PlotterGISAS()
self.every_nth = every_nth self.every_nth = every_nth
def __call__(self, params, iter, resid): def __call__(self, params, iter, resid):
......
...@@ -110,7 +110,7 @@ def run_fitting(): ...@@ -110,7 +110,7 @@ def run_fitting():
fit_objective = ba.FitObjective() fit_objective = ba.FitObjective()
fit_objective.addSimulationAndData(get_simulation, real_data, 1.0) fit_objective.addSimulationAndData(get_simulation, real_data, 1.0)
plot_observer = ba.fit_monitor.PlotterSpecular() plot_observer = ba_fitmonitor.PlotterSpecular()
fit_objective.initPrint(10) fit_objective.initPrint(10)
fit_objective.initPlot(10, plot_observer) fit_objective.initPlot(10, plot_observer)
......
...@@ -117,7 +117,7 @@ def run_fitting(): ...@@ -117,7 +117,7 @@ def run_fitting():
fit_objective = ba.FitObjective() fit_objective = ba.FitObjective()
fit_objective.addSimulationAndData(get_simulation, real_data, uncertainties) fit_objective.addSimulationAndData(get_simulation, real_data, uncertainties)
plot_observer = ba.fit_monitor.PlotterSpecular(units=ba.Axes.RQ4) plot_observer = ba_fitmonitor.PlotterSpecular(units=ba.Axes.RQ4)
fit_objective.initPrint(10) fit_objective.initPrint(10)
fit_objective.initPlot(10, plot_observer) fit_objective.initPlot(10, plot_observer)
fit_objective.setObjectiveMetric("Chi2", "L1") fit_objective.setObjectiveMetric("Chi2", "L1")
......
...@@ -20,6 +20,3 @@ from libBornAgainParam import * ...@@ -20,6 +20,3 @@ from libBornAgainParam import *
from libBornAgainSample import * from libBornAgainSample import *
from libBornAgainDevice import * from libBornAgainDevice import *
from libBornAgainCore import * from libBornAgainCore import *
from .plot_utils import *
import fit_monitor
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
""" """
# BornAgain: simulate and fit reflection and scattering # BornAgain: simulate and fit reflection and scattering
# #
# @file Wrap/Python/fit_monitor.py # @file Wrap/Python/ba_fitmonitor.py
# @brief Plotter classes for monitoring fit progress. # @brief Plotter classes for monitoring fit progress.
# #
# @homepage http://apps.jcns.fz-juelich.de/BornAgain # @homepage http://apps.jcns.fz-juelich.de/BornAgain
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
# ************************************************************************** # # ************************************************************************** #
import bornagain as ba import bornagain as ba
import plot_utils import ba_plot
try: # workaround for build servers try: # workaround for build servers
import numpy as np import numpy as np
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
from matplotlib import gridspec, colors from matplotlib import gridspec, colors
except Exception as e: except Exception as e:
print("In fit_monitor.py: {:s}".format(str(e))) print("In ba_fitmonitor.py: {:s}".format(str(e)))
label_fontsize = 16 label_fontsize = 16
...@@ -241,7 +241,7 @@ class PlotterSpecular(Plotter): ...@@ -241,7 +241,7 @@ class PlotterSpecular(Plotter):
alpha=0.6) alpha=0.6)
plt.ylim((0.5*np.min(real_values), 5*np.max(real_values))) plt.ylim((0.5*np.min(real_values), 5*np.max(real_values)))
xlabel = ba.plot_utils.get_axes_labels(real_data, self.units)[0] xlabel = ba_plot.get_axes_labels(real_data, self.units)[0]
legend = ['BornAgain', 'Data'] legend = ['BornAgain', 'Data']
if unc_values is not None: if unc_values is not None:
legend = ['BornAgain', 'Data', r'Data $\pm \sigma$'] legend = ['BornAgain', 'Data', r'Data $\pm \sigma$']
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
""" """
# BornAgain: simulate and fit reflection and scattering # BornAgain: simulate and fit reflection and scattering
# #
# @file Wrap/Python/plot_utils.py # @file Wrap/Python/ba_plot.py
# @brief Python extensions of the SWIG-generated Python module bornagain. # @brief Python extensions of the SWIG-generated Python module bornagain.
# #
# @homepage http://apps.jcns.fz-juelich.de/BornAgain # @homepage http://apps.jcns.fz-juelich.de/BornAgain
...@@ -19,7 +19,7 @@ try: # workaround for build servers ...@@ -19,7 +19,7 @@ try: # workaround for build servers
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
from matplotlib import gridspec, colors from matplotlib import gridspec, colors
except Exception as e: except Exception as e:
print("In plot_utils.py: {:s}".format(str(e))) print("In ba_plot.py: {:s}".format(str(e)))
label_fontsize = 16 label_fontsize = 16
......
...@@ -16,7 +16,7 @@ endif() ...@@ -16,7 +16,7 @@ endif()
configure_file(${WRAP_DIR}/Python/__init__.py.in configure_file(${WRAP_DIR}/Python/__init__.py.in
${CMAKE_BINARY_DIR}/lib/bornagain/__init__.py @ONLY) ${CMAKE_BINARY_DIR}/lib/bornagain/__init__.py @ONLY)
foreach(mod plot_utils.py fit_monitor.py) foreach(mod ba_plot.py ba_fitmonitor.py)
configure_file(${WRAP_DIR}/Python/${mod} ${CMAKE_BINARY_DIR}/lib/bornagain/${mod} COPYONLY) configure_file(${WRAP_DIR}/Python/${mod} ${CMAKE_BINARY_DIR}/lib/bornagain/${mod} COPYONLY)
endforeach() endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment