'--settingsFile', help='Relative path to the file with postprocessing settings', default='postprocess.json') parser.add_argument('--counter', '-c', help='Countercurrent flow', action='store_true') fig_options = FigureOptions(parser) args = parser.parse_args() doSetup = args.setup doPostProcess = args.postProcess doPlot = args.plot fileName = args.paramFile settings_file = args.settingsFile cocurrent = not args.counter param_study = ParameterStudyFactory().makeParameterStudy(fileName) if doSetup: param_study.setup() else: post_processor = make_param_study_post_processor(param_study) if doPostProcess: post_processor.run() writer = ParameterStudyPostProcessorWriter(post_processor) writer.write_results() elif doPlot: fig_options.parseOptions(args) plotter = make_param_study_plotter(post_processor, fig_options) plotter.plot_all()
nargs='+', help='Models for which to plot results', default=['krogh', 'simple']) fig_options = FigureOptions(parser) args = parser.parse_args() file_name = args.paramFile method_name = args.methodName model_names = args.modelNames fig_options.parseOptions(args) fig, axs = plt.subplots(2, 2, sharey=True) flattened_axs = [ax for sublist in axs for ax in sublist] for study, ax, text in zip(studies, flattened_axs, annotations): path_to_study = os.path.join(path_to_parameter_studies, study) path_to_study_param_file = os.path.join(path_to_study, file_name) param_study = ParameterStudyFactory().makeParameterStudy( path_to_study_param_file) settings_dict = load_settings_file(path_to_study) postprocessor = ParameterStudyPostProcessor(param_study, settings_dict) plotter = DiffusiveInteractionParameterStudyPlotter( postprocessor, fig_options, model_names) plt.sca(ax) getattr(plotter, method_name)() annotate_axis_corner(ax, text) axs[0, 1].set_ylabel('') axs[1, 1].set_ylabel('') fig_options.saveFig('plotDiffusiveInteractionMulti_{:s}'.format(method_name))
import argparse from HbO2.COSH.plotCOSH import LDvRBCCOSHParamStudyPlotter from HbO2.plot.styles import set_COSH_rc_params from HbO2.postprocess.factory.parameterstudy import make_param_study_post_processor from HbO2.setup.parameterStudy import ParameterStudyFactory from plot.figureoptions import FigureOptions set_COSH_rc_params() parser = argparse.ArgumentParser() parser.add_argument('--paramFile', help='Path to parameter study file', default='params.json') parser.add_argument('--manual-labels', action='store_true', help='Whether to set manually the contour labels') fig_options = FigureOptions(parser) args = parser.parse_args() manual_labels = args.manual_labels file_name = args.paramFile fig_options.parseOptions(args) param_study = ParameterStudyFactory().makeParameterStudy(file_name) postprocessor = make_param_study_post_processor(param_study) plotter = LDvRBCCOSHParamStudyPlotter(postprocessor, fig_options) if fig_options.blackWhite: plotter.cmap = None else: plotter.colors = None plotter.plotMultiPanelKOSContourAndOscillationDistance(manual_labels)