From 9d47fc09d8ce0d36090780cab036c6fc333f812c Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Mon, 30 Sep 2024 19:29:33 +0200 Subject: [PATCH 01/14] Fix missing initialization tttr_container_type_str was not correctly initialized --- src/TTTR.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/TTTR.cpp b/src/TTTR.cpp index 01463dd7..a9e3abcd 100644 --- a/src/TTTR.cpp +++ b/src/TTTR.cpp @@ -122,8 +122,9 @@ TTTR::TTTR(const TTTR &p2){ TTTR::TTTR(const char *fn, int container_type, bool read_input) : TTTR(){ if(container_type >= 0){ - filename.assign(fn); + tttr_container_type_str = container_names.right.at(container_type); tttr_container_type = container_type; + filename.assign(fn); if(read_input){ if(read_file()) find_used_routing_channels(); @@ -133,17 +134,6 @@ TTTR::TTTR(const char *fn, int container_type, bool read_input) : TTTR(){ } } -TTTR::TTTR(const char *fn, int container_type) : TTTR(fn, container_type, true) { - try { - tttr_container_type_str.assign( - container_names.right.at(container_type) - ); - } - catch(...) { - std::cerr << "TTTR::TTTR(const char *fn, int container_type): Container type " << container_type << " not supported." << std::endl; - } -} - TTTR::TTTR(const char *fn, const char *container_type) : TTTR() { try { tttr_container_type_str.assign(container_type); @@ -157,6 +147,17 @@ TTTR::TTTR(const char *fn, const char *container_type) : TTTR() { } } +TTTR::TTTR(const char *fn, int container_type) : TTTR(fn, container_type, true) { + try { + tttr_container_type_str.assign( + container_names.right.at(container_type) + ); + } + catch(...) { + std::cerr << "TTTR::TTTR(const char *fn, int container_type): Container type " << container_type << " not supported." << std::endl; + } +} + TTTR::TTTR(const char* filename) : TTTR(filename, inferTTTRFileType(filename), true) {} From a19dc47cb6ac4141ef8136e0bb9776d020412987 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Wed, 9 Oct 2024 14:22:22 +0200 Subject: [PATCH 02/14] Improve documentation --- test/test_TTTR_transcode.py | 54 ++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/test/test_TTTR_transcode.py b/test/test_TTTR_transcode.py index 94e044ea..5ac2aa5a 100644 --- a/test/test_TTTR_transcode.py +++ b/test/test_TTTR_transcode.py @@ -42,21 +42,39 @@ def test_write_tttr_other_header(self): self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) - def test_write_tttr_new_header(self): - """ - The container and record type of TTTR container - is changed to save an SPC file as a PTU file to disk - """ - _, filename = tempfile.mkstemp(suffix='.ptu') - data_spc = tttrlib.TTTR(settings["spc132_filename"], 'SPC-130') - header = data_spc.header - # see: TTTRHeaderTypes.h - # PQ_PTU_CONTAINER 0 - # PQ_RECORD_TYPE_HHT3v2 4 - header.tttr_container_type = 0 - header.tttr_record_type = 4 - data_spc.write(filename) - d2 = tttrlib.TTTR(filename) - self.assertEqual(np.allclose(d2.micro_times, data.micro_times), True) - self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) - self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) +def test_write_tttr_new_header(self): + """ + Tests writing a TTTR container with updated header. + + This test verifies that the TTTR library successfully saves a PTU file to disk, + and correctly reads it back into memory. The changes made to the header are specific + to SPC-130 and ensure compatibility with the updated container type and record type. + + :return: None + + :raises AssertionError: If any of the assertions in this method fail. + """ + # Create a temporary file for writing and reading + _, filename = tempfile.mkstemp(suffix='.ptu') + + # Initialize the TTTR library with SPC-130 settings + data_spc = tttrlib.TTTR(settings["spc132_filename"], 'SPC-130') + header = data_spc.header + + # Update the container and record type in the header + # see: TTTRHeaderTypes.h + # PQ_PTU_CONTAINER 0 (new) + # PQ_RECORD_TYPE_HHT3v2 4 (new) + header.tttr_container_type = 0 + header.tttr_record_type = 4 + + # Write the updated data to the temporary file + data_spc.write(filename) + + # Read the written data back into memory + d2 = tttrlib.TTTR(filename) + + # Assert that the micro_times, macro_times, and routing_channels match the original data + self.assertEqual(np.allclose(d2.micro_times, data.micro_times), True) + self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) + self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) From 194a2303bf8a9f8f10a8a5ec03a6e6b2a0e13c87 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Wed, 9 Oct 2024 14:22:46 +0200 Subject: [PATCH 03/14] Improve documentation --- test/test_TTTR_transcode.py | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/test/test_TTTR_transcode.py b/test/test_TTTR_transcode.py index 5ac2aa5a..c92975f1 100644 --- a/test/test_TTTR_transcode.py +++ b/test/test_TTTR_transcode.py @@ -42,39 +42,39 @@ def test_write_tttr_other_header(self): self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) -def test_write_tttr_new_header(self): - """ - Tests writing a TTTR container with updated header. - - This test verifies that the TTTR library successfully saves a PTU file to disk, - and correctly reads it back into memory. The changes made to the header are specific - to SPC-130 and ensure compatibility with the updated container type and record type. - - :return: None - - :raises AssertionError: If any of the assertions in this method fail. - """ - # Create a temporary file for writing and reading - _, filename = tempfile.mkstemp(suffix='.ptu') - - # Initialize the TTTR library with SPC-130 settings - data_spc = tttrlib.TTTR(settings["spc132_filename"], 'SPC-130') - header = data_spc.header - - # Update the container and record type in the header - # see: TTTRHeaderTypes.h - # PQ_PTU_CONTAINER 0 (new) - # PQ_RECORD_TYPE_HHT3v2 4 (new) - header.tttr_container_type = 0 - header.tttr_record_type = 4 - - # Write the updated data to the temporary file - data_spc.write(filename) - - # Read the written data back into memory - d2 = tttrlib.TTTR(filename) - - # Assert that the micro_times, macro_times, and routing_channels match the original data - self.assertEqual(np.allclose(d2.micro_times, data.micro_times), True) - self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) - self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) + def test_write_tttr_new_header(self): + """ + Tests writing a TTTR container with updated header. + + This test verifies that the TTTR library successfully saves a PTU file to disk, + and correctly reads it back into memory. The changes made to the header are specific + to SPC-130 and ensure compatibility with the updated container type and record type. + + :return: None + + :raises AssertionError: If any of the assertions in this method fail. + """ + # Create a temporary file for writing and reading + _, filename = tempfile.mkstemp(suffix='.ptu') + + # Initialize the TTTR library with SPC-130 settings + data_spc = tttrlib.TTTR(settings["spc132_filename"], 'SPC-130') + header = data_spc.header + + # Update the container and record type in the header + # see: TTTRHeaderTypes.h + # PQ_PTU_CONTAINER 0 (new) + # PQ_RECORD_TYPE_HHT3v2 4 (new) + header.tttr_container_type = 0 + header.tttr_record_type = 4 + + # Write the updated data to the temporary file + data_spc.write(filename) + + # Read the written data back into memory + d2 = tttrlib.TTTR(filename) + + # Assert that the micro_times, macro_times, and routing_channels match the original data + self.assertEqual(np.allclose(d2.micro_times, data.micro_times), True) + self.assertEqual(np.allclose(d2.macro_times, data.macro_times), True) + self.assertEqual(np.allclose(d2.routing_channels, data.routing_channels), True) From 279d26a98700788c03d6b1ee20080301acd58c0a Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sat, 19 Oct 2024 09:33:38 +0200 Subject: [PATCH 04/14] Fixed computation of rscatter --- include/DecayFit.h | 27 ++++++++++++++++++++++----- src/DecayFit.cpp | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/DecayFit.h b/include/DecayFit.h index bb4d1b8e..fc866e1a 100644 --- a/include/DecayFit.h +++ b/include/DecayFit.h @@ -107,7 +107,7 @@ struct DecayFitIntegrateSignals{ double Fp(){ double g = 1.0; if(corrections != nullptr){ - g = corrections->g; + g = corrections->gamma; } if(g == 1.0){ return (Sp - Bp); @@ -117,15 +117,23 @@ struct DecayFitIntegrateSignals{ } double Fs(){ - double g = 1.0; + double g = 1.0, r; if(corrections != nullptr){ - g = corrections->g; + g = corrections->gamma; } if(g == 1.0){ - return (Ss - Bs); + r = (Ss - Bs); } else{ - return (Ss - g * Bs) / (1. - g); + r = (Ss - g * Bs) / (1. - g); } +#ifdef VERBOSE_TTTRLIB + std::cout << "Fs()" << std::endl; + std::cout << "g:" << g << std::endl; + std::cout << "Ss:" << Ss << std::endl; + std::cout << "Bs:" << Bs << std::endl; + std::cout << "Fs:" << r << std::endl; +#endif + return r; } double r(){ @@ -137,6 +145,15 @@ struct DecayFitIntegrateSignals{ l1 = corrections->l1; l2 = corrections->l2; } + +#ifdef VERBOSE_TTTRLIB + std::cout << "fp:" << fp << std::endl; + std::cout << "fs:" << fs << std::endl; + std::cout << "g:" << g << std::endl; + std::cout << "l1:" << l1 << std::endl; + std::cout << "l2:" << l2 << std::endl; +#endif + double nom = (fp - g * fs); double denom = (fp * (1. - 3. * l2) + (2. - 3. * l1) * g * fs); return nom / denom; diff --git a/src/DecayFit.cpp b/src/DecayFit.cpp index 4d3cc81c..05bd5be6 100644 --- a/src/DecayFit.cpp +++ b/src/DecayFit.cpp @@ -27,7 +27,7 @@ void DecayFitIntegrateSignals::compute_signal_and_background(MParam *p) { std::cout << "-- Nchannels_exp:" << Nchannels_exp << std::endl; std::cout << "-- Bp, Bs: " << Bp << ", " << Bs << std::endl; std::cout << "-- Sp, Ss: " << Sp << ", " << Ss << std::endl; - std::cout << "-- Bexpected, Bs: " << Bp << ", " << Bs << std::endl; + std::cout << "-- Bexpected: " << Bexpected << std::endl; #endif } From 4d19f37c5bb2eddeed70a9452ae19a582b49e9aa Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sat, 19 Oct 2024 09:34:33 +0200 Subject: [PATCH 05/14] Enhancement * added get_supported_container_names --- ext/python/TTTR.py | 21 +++++++----- ext/python/misc_types.i | 3 +- include/TTTR.h | 76 +++++++++++++++++++++++++++++++++++------ src/TTTR.cpp | 47 ++++++++++++++++++++----- 4 files changed, 118 insertions(+), 29 deletions(-) diff --git a/ext/python/TTTR.py b/ext/python/TTTR.py index 69eafc48..db2a132e 100644 --- a/ext/python/TTTR.py +++ b/ext/python/TTTR.py @@ -10,19 +10,22 @@ def event_types(self): def __getattr__(self, item): """ - If an attribute `attribute` is accesses that does not exist - the corresponding getter by calling 'get_attribute' is called - - :param self: - :param item: - :return: + If an attribute `attribute` is accessed that does not exist, + the corresponding getter method ('get_attribute') is called. + Works for both instance and static methods. """ item = "get_" + str(item) + # Check if the static method or instance method exists in the class if hasattr(self.__class__, item): - call = getattr(self, item) - return call() + call = getattr(self.__class__, item) + if isinstance(call, staticmethod): + # If it's a static method, call it directly from the class + return call.__get__(None, self.__class__)() + else: + # Otherwise, assume it's an instance method + return call(self) else: - raise AttributeError + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{item}'") def __len__(self): return self.get_n_valid_events() diff --git a/ext/python/misc_types.i b/ext/python/misc_types.i index e4066264..3a735291 100644 --- a/ext/python/misc_types.i +++ b/ext/python/misc_types.i @@ -33,8 +33,9 @@ import_array(); %template(VectorUint128) std::vector; %template(VectorUint32_3D) std::vector>>; %template(VectorDouble_2D) std::vector>; -%template(MapStringString) std::map; %template(MapShortVectorDouble) std::map>; +%template(MapStringString) std::map; +%template(VectorString) std::vector; %typemap(out) std::vector< double,std::allocator< double > > * { $result = swig::from(static_cast >>(*($1))); diff --git a/include/TTTR.h b/include/TTTR.h index d783ee2c..e8187b0e 100644 --- a/include/TTTR.h +++ b/include/TTTR.h @@ -211,7 +211,21 @@ class TTTR : public std::enable_shared_from_this{ TTTRHeader *header = nullptr; /// map to translates string container types to int container types - boost::bimap container_names = {}; + static boost::bimap container_names; + + // Static function to initialize the container_names + static boost::bimap initialize_container_names() { + boost::bimap m; + m.insert({std::string("PTU"), PQ_PTU_CONTAINER}); + m.insert({std::string("HT3"), PQ_HT3_CONTAINER}); + m.insert({std::string("SPC-130"), BH_SPC130_CONTAINER}); + m.insert({std::string("SPC-600_256"), BH_SPC600_256_CONTAINER}); + m.insert({std::string("SPC-600_4096"), BH_SPC600_4096_CONTAINER}); + m.insert({std::string("PHOTON-HDF5"), PHOTON_HDF_CONTAINER}); + m.insert({std::string("CZ-RAW"), CZ_CONFOCOR3_CONTAINER}); + m.insert({std::string("SM"), SM_CONTAINER}); + return m; + } typedef bool (*processRecord_t)( uint32_t&, // input @@ -536,16 +550,36 @@ class TTTR : public std::enable_shared_from_this{ return get_n_valid_events(); } - /*! - * \brief Retrieves the used routing channel numbers from the TTTR data. - * - * This function populates the provided output array with the routing channel - * numbers that are used in the TTTR file. The number of elements in the output - * array is stored in the n_output parameter. - * - * @param output Pointer to the output array to be populated. - * @param n_output Pointer to the number of elements in the output array. - */ + /** + * Sliding window burst search. + * + * Finds bursts in the macro time array. A burst starts when the photon rate + * is above a minimum threshold, and ends when the rate falls below the same + * threshold. The rate-threshold is defined by the ratio `m`/`T` (`m` photons + * in a time interval `T`). A burst is discarded if it has less than `L` + * photons. + * + * Arguments: + * L (int): minimum number of photons in a burst. Bursts with size + * (or counts) < L are discarded. + * m (int): number of consecutive photons used to compute the rate. + * T (double): max time separation of `m` photons to be inside a burst (in seconds). + * + * Returns: + * vector: A vector of interleaved start and stop indices. + */ + std::vector burst_search(int L, int m, double T); + + /*! + * \brief Retrieves the used routing channel numbers from the TTTR data. + * + * This function populates the provided output array with the routing channel + * numbers that are used in the TTTR file. The number of elements in the output + * array is stored in the n_output parameter. + * + * @param output Pointer to the output array to be populated. + * @param n_output Pointer to the number of elements in the output array. + */ void get_used_routing_channels(signed char **output, int *n_output); /*! @@ -640,6 +674,26 @@ class TTTR : public std::enable_shared_from_this{ return tttr_container_type_str; } + /** + * @brief Retrieves a list of supported container names. + * + * This function returns a list of supported container names, e.g. 'PTU', 'SPC-130', etc.. + * + * @return std::vector + * A list of supported container names. + * + */ + static std::vector get_supported_container_names(){ + + // Extract container names from the right side of the bimap + std::vector supported_container_names; + for (const auto& element : container_names.left) { + supported_container_names.push_back(element.first); + } + + return supported_container_names; + } + /*! * \brief Creates a new TTTR object by selecting specific events based on the provided indices. * diff --git a/src/TTTR.cpp b/src/TTTR.cpp index a9e3abcd..cc7e9904 100644 --- a/src/TTTR.cpp +++ b/src/TTTR.cpp @@ -1,5 +1,8 @@ #include "TTTR.h" +// Static member definition outside the class +boost::bimap TTTR::container_names = TTTR::initialize_container_names(); + TTTR::TTTR() : // private @@ -20,14 +23,6 @@ TTTR::TTTR() : n_records_read(0), n_valid_events(0), processRecord(nullptr){ - container_names.insert({std::string("PTU"), PQ_PTU_CONTAINER}); - container_names.insert({std::string("HT3"), PQ_HT3_CONTAINER}); - container_names.insert({std::string("SPC-130"), BH_SPC130_CONTAINER}); - container_names.insert({std::string("SPC-600_256"), BH_SPC600_256_CONTAINER}); - container_names.insert({std::string("SPC-600_4096"), BH_SPC600_4096_CONTAINER}); - container_names.insert({std::string("PHOTON-HDF5"), PHOTON_HDF_CONTAINER}); - container_names.insert({std::string("CZ-RAW"), CZ_CONFOCOR3_CONTAINER}); - container_names.insert({std::string("SM"), SM_CONTAINER}); header = new TTTRHeader(tttr_container_type); allocate_memory_for_records(0); } @@ -753,6 +748,42 @@ void selection_by_count_rate( } } + +std::vector TTTR::burst_search(int L, int m, double T) { + + int64_t i, i_start, i_stop; + uint8_t in_burst = 0; + + std::vector bursts; // Now storing interleaved start and stop indices + long long Ti = T / header->get_macro_time_resolution(); + + for (i = 0; i <= size() - m; ++i) { + if (macro_times[i + m - 1] - macro_times[i] <= Ti) { + if (!in_burst) { + in_burst = 1; + i_start = i; + } + } else if (in_burst) { + in_burst = 0; + i_stop = i + m - 2; + if (i_stop - i_start + 1 >= L) { + bursts.push_back(i_start); + bursts.push_back(i_stop); + } + } + } + + if (in_burst) { + i_stop = i + m - 1; + if (i_stop - i_start + 1 >= L) { + bursts.push_back(i_start); + bursts.push_back(i_stop); + } + } + + return bursts; +} + unsigned int TTTR::get_number_of_micro_time_channels(){ return header->get_effective_number_of_micro_time_channels(); } From 3e848630afbe6fabc61c3871d9daaa46af2eb54e Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sat, 19 Oct 2024 09:34:55 +0200 Subject: [PATCH 06/14] Improved documentation --- test/test_TTTR.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/test/test_TTTR.py b/test/test_TTTR.py index 7caee365..ea2c40d9 100644 --- a/test/test_TTTR.py +++ b/test/test_TTTR.py @@ -69,13 +69,34 @@ def test_write_ptu_header(self): if t2 not in d3['tags']: all_tags = False break + self.assertEqual(all_tags, True) def test_tttr_header_add_tags(self): + """ + Tests adding tags to an existing TTTR header. + + This test verifies that when tags from another TTTR header are added to an existing one, + the number of tags in the original header is not reduced, but rather increased or maintained. + + :return: None + + :raises AssertionError: If any of the assertions in this method fail. + """ + # Initialize the TTTR library with SPC-130 settings data = tttrlib.TTTR(settings["spc132_filename"], "SPC-130") - header2 = tttrlib.TTTRHeader(settings["ptu_hh_t3_filename"], 0) # 0 is the container type - self.assertEqual(len(data.header.tags) < len(header2.tags), True) + + # Initialize a new TTTR header for comparison + # Use PTU file type with container type 0 (new) + header2 = tttrlib.TTTRHeader(settings["ptu_hh_t3_filename"], 0) # 0 is the container type + + # Assert that the original data has fewer tags than the new header + self.assertEqual(len(data.header.tags), len(header2.tags)) # Use '==' instead of '<' for equality + + # Add tags from the new header to the existing one data.header.add_tags(header2) + + # Assert that the number of tags in the original header is now greater than or equal to self.assertEqual(len(data.header.tags) >= len(header2.tags), True) def test_reading(self): From 94b94c0fbc82140ab135323c3126cbd3538cbc1c Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:12:39 +0100 Subject: [PATCH 07/14] Updated changes.rst --- doc/whats_new/changes.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/whats_new/changes.rst b/doc/whats_new/changes.rst index f47edb35..279a4cc3 100644 --- a/doc/whats_new/changes.rst +++ b/doc/whats_new/changes.rst @@ -2,14 +2,17 @@ .. _changes_0_23: -Version 0.24 +Version 0.25 ============ +* Add simpler option for burst search +* Added get_supported_container_names +Version 0.24 +----------- * Add support for sm files * Add support for CZ CF3 FCS files * Improved type tttr file type inference to mitigate crashes - Version 0.23 ------------ * Consider background with certain fraction in mean lifetime (0.23.6) From a00acc84e4d7f293b6b0892fa8b970aa7dda9972 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:13:00 +0100 Subject: [PATCH 08/14] Cleanup --- tools/README.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tools/README.md diff --git a/tools/README.md b/tools/README.md deleted file mode 100644 index d07e8507..00000000 --- a/tools/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# conda_config - -Conda build config files used in skd and chisurf - -These scripts/settings are meant to -be used with mambaforge docker. \ No newline at end of file From c06adbb9984c248361e008e4d0a38e2ccdb1ba4d Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:14:56 +0100 Subject: [PATCH 09/14] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 582901a9..f344e06d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -version = "0.24.4" +version = "0.25.0" name = "tttrlib" requires-python = ">=3.8" description = "Read, write & process time-tagged time-resolved (TTTR) data." From 4f5488994e441a73cf73d2e110399b05d8b378f6 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:28:06 +0100 Subject: [PATCH 10/14] Pin SWIG version --- conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 7147f922..fc5f3d04 100755 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -24,7 +24,7 @@ requirements: - ninja - make # [linux] - doxygen - - swig + - swig 4.2.* - python - numpy host: From d73dcddfa2881a87177c7c406f91782fa474d793 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:42:18 +0100 Subject: [PATCH 11/14] Fix miniconda build There are known issues with mamba --- .github/workflows/conda-build.yml | 6 ++---- .github/workflows/release.yml | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index dff78c8a..c0dddb05 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -24,12 +24,10 @@ jobs: - name: Set up Conda uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - mamba-version: "*" + miniconda-version: "latest" channels: conda-forge,defaults channel-priority: true - + activate-environment: base - name: Display Conda Settings shell: bash -el {0} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d01ddb9..f6a9d628 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,11 +24,10 @@ jobs: - name: Set up Conda uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - mamba-version: "*" + miniconda-version: "latest" channels: conda-forge,defaults channel-priority: true + activate-environment: base - name: Display Conda Settings shell: bash -el {0} From e9bf6704f09a332fe76556e300cdfbdf766e686c Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:44:34 +0100 Subject: [PATCH 12/14] Fix miniconda build There are known issues with mamba --- .github/workflows/conda-build.yml | 2 +- .github/workflows/release.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index c0dddb05..6fd7d49d 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -27,7 +27,7 @@ jobs: miniconda-version: "latest" channels: conda-forge,defaults channel-priority: true - activate-environment: base + - name: Display Conda Settings shell: bash -el {0} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6a9d628..082cb9f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,6 @@ jobs: miniconda-version: "latest" channels: conda-forge,defaults channel-priority: true - activate-environment: base - name: Display Conda Settings shell: bash -el {0} From 77ded53f558d1bba28d060e1b552b240ef3292e3 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 10:46:25 +0100 Subject: [PATCH 13/14] Fix miniconda build There are known issues with mamba --- .github/workflows/conda-build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 6fd7d49d..f9f17c11 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -44,7 +44,7 @@ jobs: - name: Build Conda Package shell: bash -el {0} run: | - mamba install conda-build boa + conda install conda-build boa mamba cd conda-recipe curl -sLO https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/084b098a28a7a66e9a0967d156bc55b9ebfc6726/recipe/conda_build_config.yaml # curl -sLO https://github.com/conda-forge/conda-forge-pinning-feedstock/raw/main/recipe/conda_build_config.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 082cb9f6..2f130316 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: - name: Build and Upload Conda Package shell: bash -el {0} run: | - mamba install conda-build boa anaconda-client + conda install conda-build mamba boa anaconda-client cd conda-recipe # Use older conda_build_config -> boost-cpp 1.78 # curl -sLO https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/084b098a28a7a66e9a0967d156bc55b9ebfc6726/recipe/conda_build_config.yaml From 2b55ee0f08853dd57e0bdcc7b7e14ed803990279 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Sun, 27 Oct 2024 11:10:48 +0100 Subject: [PATCH 14/14] Update to recent conda_build_config --- .github/workflows/conda-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index f9f17c11..f4c16106 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -46,6 +46,6 @@ jobs: run: | conda install conda-build boa mamba cd conda-recipe - curl -sLO https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/084b098a28a7a66e9a0967d156bc55b9ebfc6726/recipe/conda_build_config.yaml - # curl -sLO https://github.com/conda-forge/conda-forge-pinning-feedstock/raw/main/recipe/conda_build_config.yaml + # curl -sLO https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/084b098a28a7a66e9a0967d156bc55b9ebfc6726/recipe/conda_build_config.yaml + curl -sLO https://github.com/conda-forge/conda-forge-pinning-feedstock/raw/main/recipe/conda_build_config.yaml conda mambabuild .