Skip to content

Commit

Permalink
small fix to header generation to handle two parameters with the same…
Browse files Browse the repository at this point in the history
… name in the corner plots
  • Loading branch information
Immudzen committed Oct 1, 2019
1 parent 42e4851 commit e598e1e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CADETMatch.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: CADETMatch
Version: 0.4.1
Version: 0.4.2
Summary: CADETMatch is a parameter estimation and error modeling library for CADET
Home-page: https://github.com/modsim/CADET-Match
Author: William Heymann
Expand Down
6 changes: 3 additions & 3 deletions CADETMatch/CADETMatch.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>0067cb6f-0de6-4dd6-8086-20ea899a691d</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>match.py</StartupFile>
<StartupFile>generate_corner_graphs.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>..</WorkingDirectory>
Expand All @@ -14,9 +14,9 @@
<IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>CondaEnv|CondaEnv|CADETMatch</InterpreterId>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>"F:\temp\cadet_tutorial\lesson_5\multiple_components\example_nsga3_fractionation.json" 2</CommandLineArguments>
<CommandLineArguments>"F:\temp\cadet_tutorial\lesson_5\multiple_parameters\fit_nsga3\example_nsga3.json" 2</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<InterpreterArguments>-m scoop -n 6</InterpreterArguments>
<InterpreterArguments>-m scoop -n 1</InterpreterArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
13 changes: 12 additions & 1 deletion CADETMatch/generate_corner_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,21 @@ def plotMCMCVars(out_dir, headers, data):
plotMCMCParam(out_dir, param_idx, data.root.run_chain_stat, "Run " + header + str(param_idx))
plotMCMCParam(out_dir, param_idx, data.root.run_chain_stat_transform, "Run " + header + " Transform" + str(param_idx))

def keep_header(char):
allowed = set('-0123456789')
return char in allowed

def clean_header(header):
splits = header.split()
temp = [splits[0]]
for string in splits[1:]:
temp.append(''.join([i for i in string if keep_header(i)]))
return ' '.join(temp)

def graphCorner(cache):
scoop.logger.info("plotting corner plots")
headers = list(cache.parameter_headers_actual)
headers = [header.split()[0] for header in headers]
headers = [clean_header(header) for header in headers]

resultDir = Path(cache.settings['resultsDir'])
result_h5 = resultDir / "result.h5"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="CADETMatch",
version="0.4.2",
version="0.4.3",
author="William Heymann",
author_email="[email protected]",
description="CADETMatch is a parameter estimation and error modeling library for CADET",
Expand Down

0 comments on commit e598e1e

Please sign in to comment.