Skip to content
Snippets Groups Projects
Commit 25f1feb8 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

reactivate NOPLOT -> NOSHOW environment variable; PyStd still esgfaults

parent e6d41abf
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,7 @@ def plot(results): ...@@ -104,7 +104,7 @@ def plot(results):
""" """
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
ba.plot_simulation_result(results, postpone_show=True) ba.plot_simulation_result(results, noshow=True)
genx_axis, genx_values = create_real_data() genx_axis, genx_values = create_real_data()
......
...@@ -43,11 +43,11 @@ std::unique_ptr<OutputData<double>> domainData(const std::string& test_name, ...@@ -43,11 +43,11 @@ std::unique_ptr<OutputData<double>> domainData(const std::string& test_name,
const std::string py_command = pyscript_filename + " " + output_path; const std::string py_command = pyscript_filename + " " + output_path;
#ifndef _WIN32 #ifndef _WIN32
const std::string sys_command = std::string("PYTHONPATH=") + BABuild::buildLibDir() + " " const std::string sys_command = std::string("PYTHONPATH=") + BABuild::buildLibDir() + " "
+ std::string("NOPLOT=TRUE") + " " + BABuild::pythonExecutable() + std::string("NOSHOW=TRUE") + " " + BABuild::pythonExecutable()
+ " -B " + py_command; + " -B " + py_command;
#else #else
const std::string sys_command = std::string("set PYTHONPATH=") + BABuild::buildLibDir() + " & " const std::string sys_command = std::string("set PYTHONPATH=") + BABuild::buildLibDir() + " & "
+ std::string("set NOPLOT=TRUE") + " & \"" + std::string("set NOSHOW=TRUE") + " & \""
+ BABuild::pythonExecutable() + "\" -B " + py_command; + BABuild::pythonExecutable() + "\" -B " + py_command;
#endif #endif
std::cout << "- system call: " << sys_command << std::endl; std::cout << "- system call: " << sys_command << std::endl;
......
...@@ -21,7 +21,5 @@ from libBornAgainSample import * ...@@ -21,7 +21,5 @@ from libBornAgainSample import *
from libBornAgainDevice import * from libBornAgainDevice import *
from libBornAgainCore import * from libBornAgainCore import *
# To prevent inclusion of plotting tools during functional tests: from .plot_utils import *
if not "NOPLOT" in os.environ: import fit_monitor
from .plot_utils import *
import fit_monitor
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
""" """
# ************************************************************************** # # ************************************************************************** #
import os
import bornagain as ba import bornagain as ba
try: # workaround for build servers try: # workaround for build servers
import numpy as np import numpy as np
...@@ -201,16 +202,18 @@ def plot_simulation_result(result, **kwargs): ...@@ -201,16 +202,18 @@ def plot_simulation_result(result, **kwargs):
:param intensity_min: Min value on amplitude's axis or color bar :param intensity_min: Min value on amplitude's axis or color bar
:param intensity_max: Max value on amplitude's axis or color bar :param intensity_max: Max value on amplitude's axis or color bar
:param units: units for plot axes :param units: units for plot axes
:param postpone_show: postpone showing the plot for later tuning (False by default) :param noshow: don't plot to interactive device
""" """
postpone_show = kwargs.pop('postpone_show', False) ns = "NOSHOW" in os.environ
noshow = kwargs.pop('noshow', ns)
print(f'DEBUG ns={ns}, noshow={noshow}, kwargs={kwargs}')
if len(result.array().shape) == 1: # 1D data, specular simulation assumed if len(result.array().shape) == 1: # 1D data, specular simulation assumed
plot_specular_simulation_result(result, **kwargs) plot_specular_simulation_result(result, **kwargs)
else: else:
plot_colormap(result, **kwargs) plot_colormap(result, **kwargs)
plt.tight_layout() plt.tight_layout()
if not (postpone_show): if not (noshow):
plt.show() plt.show()
def run_and_plot(simulation, **kwargs): def run_and_plot(simulation, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment