From 681b554a795b56731005bd3655eb9be295b8a4dc Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 15 Mar 2024 14:05:12 -0400 Subject: [PATCH] Fixed a problem that occurs in multithreading scheduling when only one of the sections "electrical-parameters" or "physical-parameters" is present (also if neither is present). The code was making the assumption that both exist and was looking for a list of two results. --- cace/__version__.py | 2 +- cace/cace_cli.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cace/__version__.py b/cace/__version__.py index 8bbbd41..6a61575 100644 --- a/cace/__version__.py +++ b/cace/__version__.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -__version__ = '2.1.9' +__version__ = '2.1.10' if __name__ == '__main__': print(__version__, end='') diff --git a/cace/cace_cli.py b/cace/cace_cli.py index 8313f3d..cedd6a3 100755 --- a/cace/cace_cli.py +++ b/cace/cace_cli.py @@ -492,14 +492,15 @@ def cace_run(datasheet, paramname=None): print('cace_run_all_[e|p]param failed with exception:') print(e) presult = None - if presult: - poolresult.append(presult) + poolresult.append(presult) # The pool results may arrive in either order, so arrange them properly. - idx0 = poolresult[0][0] - idx1 = poolresult[1][0] - datasheet['electrical_parameters'] = poolresult[idx0][1:] - datasheet['physical_parameters'] = poolresult[idx1][1:] + if poolresult[0]: + idx0 = poolresult[0][0] + datasheet['electrical_parameters'] = poolresult[idx0][1:] + if poolresult[1]: + idx1 = poolresult[1][0] + datasheet['physical_parameters'] = poolresult[idx1][1:] return datasheet