From 102ae1ce62eb36d8b24257855e3209627e50478b Mon Sep 17 00:00:00 2001 From: Ben Pruitt Date: Mon, 18 Sep 2023 22:21:09 -0400 Subject: [PATCH] 2.0.1 release (#124) * Missing space in change-log * fix ``todict`` method of ``Thermoanalysis`` and add unit test coverage (#123) * version bump to 2.0.1 + release notes update --------- Co-authored-by: Peter Cock --- CHANGES | 6 +++++- primer3/__init__.py | 2 +- primer3/thermoanalysis.pyx | 4 ++-- tests/test_thermoanalysis.py | 23 ++++++++++++++++++++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 3a7ba8f..e142129 100644 --- a/CHANGES +++ b/CHANGES @@ -1,12 +1,16 @@ # Changelog +## Version 2.0.1 (September 18, 2023) + +- Fixed bug in `todict` method of `ThermoAnalysis` + ## Version 2.0.0 (May 30, 2023) - Migrated primer3 header file Cython extern imports to `thermoanalysis.pxi` - Optional C structure string argument `c_ascii_structure` added to `_ThermoAnalysis` methods to enable 3rd party use for structures - Version bump to 2.0.0 due to breaking change - Fix issue whereby no_structure is not correctly 1 set to 1 when no secondary structure in found -- Add list version of `PRIMER_{PAIR, LEFT, RIGHT, INTERNAL}` to design output dictionary keys.Retaining original keys as well for compatibility. +- Add list version of `PRIMER_{PAIR, LEFT, RIGHT, INTERNAL}` to design output dictionary keys. Retaining original keys as well for compatibility. - Fix for missing `thal_result.sec_struct` and `dpal_results.sec_struct` initialization to `NULL` in `recalc_primer_sec_struct` ## Version 1.2.2 (May 16, 2023) diff --git a/primer3/__init__.py b/primer3/__init__.py index 81d8f18..8ef700c 100644 --- a/primer3/__init__.py +++ b/primer3/__init__.py @@ -26,7 +26,7 @@ from typing import List # Per PEP-440 https://peps.python.org/pep-0440/#public-version-identifiers -__version__ = '2.0.0' +__version__ = '2.0.1' __author__ = 'Ben Pruitt, Nick Conway' __copyright__ = ( 'Copyright 2014-2023, Ben Pruitt & Nick Conway; 2014-2018 Wyss Institute' diff --git a/primer3/thermoanalysis.pyx b/primer3/thermoanalysis.pyx index 89e0ab5..e773761 100644 --- a/primer3/thermoanalysis.pyx +++ b/primer3/thermoanalysis.pyx @@ -548,7 +548,7 @@ cdef class _ThermoAnalysis: representation. ''' - return self._salt_correction_method + return self._salt_correction_methods_int_dict[self._salt_correction_method] @salt_correction_method.setter def salt_correction_method(self, value: Union[int, str]): @@ -1082,7 +1082,7 @@ cdef class _ThermoAnalysis: 'dv_conc': self.dv_conc, 'dntp_conc': self.dntp_conc, 'dna_conc': self.dna_conc, - 'temp_c': self.temp, + 'temp_c': self.temp_c, 'max_loop': self.max_loop, # 'temp_only': self.temp_only, # 'debug': self.thalargs.debug, diff --git a/tests/test_thermoanalysis.py b/tests/test_thermoanalysis.py index 39c904e..b9037c5 100644 --- a/tests/test_thermoanalysis.py +++ b/tests/test_thermoanalysis.py @@ -34,7 +34,10 @@ except (ImportError, ModuleNotFoundError): # For Windows compatibility resource = None # type: ignore -from primer3 import bindings +from primer3 import ( + bindings, + thermoanalysis, +) from . import wrappers @@ -409,6 +412,24 @@ def test_memory_leaks(self): f'\n\t memory leak (mem increase: {em - sm})', ) + def test_todict(self): + '''Unit test coverage for ``Thermoanalysis.todict``''' + args = { + 'mv_conc': 51.0, + 'dv_conc': 1.7, + 'dntp_conc': 0.5, + 'dna_conc': 52.0, + 'temp_c': 36.0, + 'max_loop': 31, + 'max_nn_length': 61, + 'tm_method': 'santalucia', + 'salt_correction_method': 'santalucia', + } + ta = thermoanalysis.ThermoAnalysis(**args) + dict_out = ta.todict() + for k, v in args.items(): + assert v == dict_out[k] + def suite(): '''Define the test suite'''