From 24f1aac6c0a52afe0450961f1bdf28f533203745 Mon Sep 17 00:00:00 2001 From: Mario Picciani Date: Fri, 16 Aug 2024 13:27:36 +0200 Subject: [PATCH 1/4] added koinapy and extend superclass --- oktoberfest/predict/koina.py | 514 +---------------------------------- poetry.lock | 514 ++++++++++++++++++++++++++++------- pyproject.toml | 1 + requirements.txt | 23 +- 4 files changed, 436 insertions(+), 616 deletions(-) diff --git a/oktoberfest/predict/koina.py b/oktoberfest/predict/koina.py index 4fc1764..b77a15a 100644 --- a/oktoberfest/predict/koina.py +++ b/oktoberfest/predict/koina.py @@ -1,19 +1,9 @@ import logging -import time -import warnings -from functools import partial -from typing import Dict, Generator, KeysView, List, Optional, Union +from typing import Dict, Union import numpy as np import pandas as pd -from tqdm.auto import tqdm -from tritonclient.grpc import ( - InferenceServerClient, - InferenceServerException, - InferInput, - InferRequestedOutput, - InferResult, -) +from koinapy.grpc import Koina as _KoinaGRPC from ..data.spectra import Spectra @@ -29,414 +19,10 @@ } -class Koina: - """A class for interacting with Koina models for inference.""" +class Koina(_KoinaGRPC): + """Extension of the Koina GRPC class in koinapy, to add required logic for Oktoberfest.""" - model_inputs: Dict[str, str] - model_outputs: Dict[str, np.ndarray] - batch_size: int - _response_dict: Dict[int, Union[InferResult, InferenceServerException]] - - def __init__( - self, - model_name: str, - server_url: str = "koina.wilhelmlab.org:443", - ssl: bool = True, - targets: Optional[List[str]] = None, - disable_progress_bar: bool = False, - ): - """ - Initialize a KoinaModel instance with the specified parameters. - - This constructor initializes the KoinaModel instance, connecting it to the specified Inference Server. - It checks the availability of the server, the specified model, retrieves input and output information, - and determines the maximum batch size supported by the model's configuration. - Note: To use this class, ensure that the inference server is properly configured and running, - and that the specified model is available on the server. - - :param model_name: The name of the Koina model to be used for inference. - :param server_url: The URL of the inference server. Defaults to "koina.wilhelmlab.org:443". - :param ssl: Indicates whether to use SSL for communication with the server. Defaults to True. - :param targets: An optional list of targets to predict. If this is None, all model targets are - predicted and received. - :param disable_progress_bar: Whether to disable the progress bar showing the progress of predictions. - """ - self.model_inputs = {} - self.model_outputs = {} - self._response_dict = {} - - self.model_name = model_name - self.url = server_url - self.ssl = ssl - self.disable_progress_bar = disable_progress_bar - self.client = InferenceServerClient(url=server_url, ssl=ssl) - - self.type_convert = { - "FP32": np.dtype("float32"), - "BYTES": np.dtype("O"), - "INT16": np.dtype("int16"), - "INT32": np.dtype("int32"), - "INT64": np.dtype("int64"), - } - - self._is_server_ready() - self._is_model_ready() - - self.__get_inputs() - self.__get_outputs(targets) - self.__get_batchsize() - - @property - def response_dict(self): - """The dictionary containing raw InferenceResult/InferenceServerException objects (values) for a given request_id (key).""" - return self._response_dict - - def _is_server_ready(self): - """ - Check if the inference server is live and accessible. - - This method checks the availability of the inference server and raises an exception if it is not live or - accessible. It ensures that the server is properly running and can be used for inference with the Koina - model. Note: This method is primarily for internal use and typically called during model initialization. - - :raises ValueError: If the server responds with a not live status - :raises InferenceServerException: If an exception occured while querying the server for its status. - """ - try: - if not self.client.is_server_live(): - raise ValueError("Server not yet started.") - except InferenceServerException as e: - if self.url in ["koina.wilhelmlab.org:443", "koina.proteomicsdb.org:443"]: - if self.ssl: - raise InferenceServerException( - "The public koina network seems to be inaccessible at the moment. " - "Please notify ludwig.lautenbacher@tum.de." - ) from e - else: - raise InferenceServerException("To use the public koina network you need to set `ssl=True`.") from e - raise InferenceServerException("Unknown error occured.", e.status(), e.debug_details()) from e - - def _is_model_ready(self): - """ - Check if the specified model is available on the server. - - This method checks if the specified Koina model is available on the inference server. If the model is not - available, it raises an exception indicating that the model is not accessible at the provided server URL. - Note: This method is primarily for internal use and typically called during model initialization. - - :raises ValueError: If the specified model is not available at the server. - :raises InferenceServerException: If an exception occured while querying the server for available models. - """ - try: - if not self.client.is_model_ready(self.model_name): - raise ValueError(f"The model {self.model_name} is not available at {self.url}") - except InferenceServerException as e: - raise InferenceServerException("Unknown error occured.", e.status(), e.debug_details()) from e - - def __get_inputs(self): - """ - Retrieve the input names and datatypes for the model. - - This method fetches the names and data types of the input tensors for the Koina model and stores them in - the 'model_inputs' attribute. Note: This method is for internal use and is typically called during model - initialization. - - :raises InferenceServerException: If an exception occured while querying the server for model inputs. - """ - try: - self.model_inputs = {i.name: i.datatype for i in self.client.get_model_metadata(self.model_name).inputs} - except InferenceServerException as e: - raise InferenceServerException("Unknown error occured.", e.status(), e.debug_details()) from e - - def __get_outputs(self, targets: Optional[List] = None): - """ - Retrieve the output names and datatypes for the model. - - This method fetches the names and data types of the output tensors for the Koina model and stores them in - the 'model_outputs' attribute. If a list of target names is supplied, the tensors are filtered for those. - In case that the targets contain a name that is not a valid output of the requested model, a ValueError is - raised. Note: This method is for internal use and is typically called during model initialization. - - :param targets: An optional list of target names to filter the predictions for. If this is None, all targets - are added to list of output tensors to predict. - :raises ValueError: If a target supplied is not a valid output name of the requested model. - :raises InferenceServerException: If an exception occured while querying the server for model metadata. - - """ - try: - model_outputs = self.client.get_model_metadata(self.model_name).outputs - model_targets = [out.name for out in model_outputs] - - if targets is None: - targets = model_targets - else: - for target in targets: - if target not in model_targets: - raise ValueError( - f"The supplied target {target} is not a valid output target of the model. " - f"Valid targets are {model_targets}." - ) - for i in model_outputs: - if i.name in targets: - self.model_outputs[i.name] = i.datatype - except InferenceServerException as e: - raise InferenceServerException("Unknown error occured.", e.status(), e.debug_details()) from e - - def __get_batchsize(self): - """ - Get the maximum batch size supported by the model's configuration. - - This method determines the maximum batch size supported by the Koina model's configuration and stores it - in the 'batchsize' attribute. Note: This method is for internal use and is typically called during model - initialization. - :raises InferenceServerException: If an exception occured while querying the server for the max batchsize. - """ - try: - self.batchsize = self.client.get_model_config(self.model_name).config.max_batch_size - except InferenceServerException as e: - raise InferenceServerException("Unknown error occured.", e.status(), e.debug_details()) from e - - @staticmethod - def __get_batch_outputs(names: KeysView[str]) -> List[InferRequestedOutput]: - """ - Create InferRequestedOutput objects for the given output names. - - This method generates InferRequestedOutput objects for the specified output names. InferRequestedOutput objects - are used to request specific outputs when performing inference. Note: This method is for internal use and is - typically called during inference. - - :param names: A list of output names for which InferRequestedOutput objects should be created. - - :return: A list of InferRequestedOutput objects. - """ - return [InferRequestedOutput(name) for name in names] - - def __get_batch_inputs(self, data: Dict[str, np.ndarray]) -> List[InferInput]: - """ - Prepare a list of InferInput objects for the input data. - - This method prepares a list of InferInput objects for the provided input data. InferInput objects are used to - specify the input tensors and their data when performing inference. Note: This method is for internal use and - is typically called during inference. - - :param data: A dictionary containing input data for inference. Keys are input names, and values are numpy arrays. - - :return: A list of InferInput objects for the input data. - """ - batch_inputs = [] - for iname, idtype in self.model_inputs.items(): - batch_inputs.append(InferInput(iname, (len(data[next(iter(data))]), 1), idtype)) - batch_inputs[-1].set_data_from_numpy(data[iname].reshape(-1, 1).astype(self.type_convert[idtype])) - return batch_inputs - - def __extract_predictions(self, infer_result: InferResult) -> Dict[str, np.ndarray]: - """ - Extract the predictions from an inference result. - - This method extracts the predictions from an inference result and organizes them in a dictionary with output - names as keys and corresponding arrays as values. Note: This method is for internal use and is typically called - during inference. - - :param infer_result: The result of an inference operation. - - :return: A dictionary containing the extracted predictions. Keys are output names, and values are numpy arrays. - """ - predictions = {} - for oname in self.model_outputs.keys(): - predictions[oname] = infer_result.as_numpy(oname) - return predictions - - def __predict_batch(self, data: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]: - """ - Perform batch inference and return the predictions. - - This method performs batch inference on the provided input data using the configured Koina model and returns the - predictions. Note: This method is for internal use and is typically called during inference. - - :param data: A dictionary containing input data for batch inference. Keys are input names, and values are numpy arrays. - - :return: A dictionary containing the model's predictions. Keys are output names, and values are numpy arrays - representing the model's output. - """ - batch_outputs = self.__get_batch_outputs(self.model_outputs.keys()) - batch_inputs = self.__get_batch_inputs(data) - infer_result = self.client.infer(self.model_name, inputs=batch_inputs, outputs=batch_outputs) - - return self.__extract_predictions(infer_result) - - def __predict_sequential(self, data: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]: - """ - Perform sequential inference and return the predictions. - - This method performs sequential inference on the provided input data using the configured Koina model. It processes - the input data batch by batch and returns the predictions. - Note: This method is for internal use and is typically called during inference. - - :param data: A dictionary containing input data for inference. Keys are input names, and values are numpy arrays. - - :return: A dictionary containing the model's predictions. Keys are output names, and values are numpy arrays representing - the model's output. - """ - predictions: Dict[str, np.ndarray] = {} - for data_batch in tqdm(self.__slice_dict(data, self.batchsize), desc="Getting predictions"): - pred_batch = self.__predict_batch(data_batch) - if predictions: - predictions = self.__merge_array_dict(predictions, pred_batch) - else: - predictions = pred_batch # Only first iteration to initialize dict keys - return predictions - - @staticmethod - def __slice_dict(data: Dict[str, np.ndarray], batchsize: int) -> Generator[Dict[str, np.ndarray], None, None]: - """ - Slice the input data into batches of a specified batch size. - - This method takes the input data and divides it into smaller batches, each containing 'batchsize' elements. It yields - these batches one at a time, allowing for batched processing of input data. Note: This method is for internal use and - is typically called during batched inference. - - :param data: A dictionary containing input data for batch inference. Keys are input names, and values are numpy arrays. - :param batchsize: The desired batch size for slicing the data. - - :yield: A dictionary containing a batch of input data with keys and values corresponding to the input names and - batched arrays. - """ - len_inputs = list(data.values())[0].shape[0] - for i in range(0, len_inputs, batchsize): - dict_slice = {} - for k, v in data.items(): - dict_slice[k] = v[i : i + batchsize] - yield dict_slice - - @staticmethod - def __merge_array_dict(d1: Dict[str, np.ndarray], d2: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]: - """ - Merge two dictionaries of arrays. - - This method takes two dictionaries, 'd1' and 'd2', each containing arrays with identical keys. It merges the - arrays from both dictionaries, creating a new dictionary with the same keys and combined arrays. Note: This - method is for internal use and is typically called during batched inference. - - :param d1: A dictionary containing arrays. - :param d2: Another dictionary containing arrays with the same keys as d1. - - :raises NotImplementedError: If the keys in 'd1' and 'd2' do not match. - :return: A dictionary containing merged arrays with the same keys as d1 and d2. - - Example: - ``` - dict1 = {"output1": np.array([1.0, 2.0, 3.0]), "output2": np.array([4.0, 5.0, 6.0])} - dict2 = {"output1": np.array([7.0, 8.0, 9.0]), "output2": np.array([10.0, 11.0, 12.0])} - merged_dict = model.__merge_array_dict(dict1, dict2) - print(merged_dict) - ``` - """ - if d1.keys() != d2.keys(): - raise NotImplementedError(f"Keys in dictionary need to be equal {d1.keys(), d2.keys()}") - out = {} - for k in d1.keys(): - out[k] = np.concatenate([d1[k], d2[k]]) - return out - - @staticmethod - def __merge_list_dict_array(dict_list: List[Dict[str, np.ndarray]]) -> Dict[str, np.ndarray]: - """ - Merge a list of dictionaries of arrays. - - This method takes a list of dictionaries, where each dictionary contains arrays with identical keys. It merges - the arrays from all dictionaries in the list, creating a new dictionary with the same keys and combined arrays. - Note: This method is for internal use and is typically called during batched inference. - - :param dict_list: A list of dictionaries, each containing arrays with the same keys. - :raises NotImplementedError: If the keys of all dictionaries in the list do not match. - - :return: A dictionary containing merged arrays with the same keys as the dictionaries in the list. - - Example:: - dict_list = [ - {"output1": np.array([1.0, 2.0, 3.0]), "output2": np.array([4.0, 5.0, 6.0])}, - {"output1": np.array([7.0, 8.0, 9.0]), "output2": np.array([10.0, 11.0, 12.0])}, - {"output1": np.array([13.0, 14.0, 15.0]), "output2": np.array([16.0, 17.0, 18.0])}, - ] - merged_dict = model.__merge_list_dict_array(dict_list) - print(merged_dict) - """ - tmp = [x.keys() for x in dict_list] - if not np.all([tmp[0] == x for x in tmp]): - raise NotImplementedError(f"Keys of all dictionaries in the list need to be equal {tmp}") - out = {} - for k in tmp[0]: - out[k] = np.concatenate([x[k] for x in dict_list]) - return out - - def __async_callback( - self, - infer_results: Dict[int, Union[Dict[str, np.ndarray], InferenceServerException]], - request_id: int, - result: Optional[InferResult], - error: Optional[InferenceServerException], - ): - """ - Callback function for asynchronous inference. - - This method serves as a callback function for asynchronous inference. It is invoked when an asynchronous - inference task is completed. The result of the task is appended to the 'infer_results' list, and any - encountered error is checked and handled appropriately. Note: This method is for internal use and is typically - called during asynchronous inference. - - :param infer_results: A dictionary to which the results of asynchronous inference will be added. - :param request_id: The request id used as key in the infer_results dictionary - :param result: The result of an asynchronous inference operation. - :param error: An error, if any, encountered during asynchronous inference. - """ - if error: - infer_results[request_id] = error - else: - infer_results[request_id] = self.__extract_predictions(result) - - def __async_predict_batch( - self, - data: Dict[str, np.ndarray], - infer_results: Dict[int, Union[Dict[str, np.ndarray], InferenceServerException]], - request_id: int, - timeout: int = 60000, - retries: int = 5, - ): - """ - Perform asynchronous batch inference on the given data using the Koina model. - - This method initiates asynchronous batch inference on the provided input data using the configured Koina model. - Results will be appended to the 'infer_results' list as they become available. The 'id' parameter is used to - identify and order the results. The method will return when the inference request is completed or when the - 'timeout' is reached. - - :param data: A dictionary containing input data for batch inference. Keys are input names, and values are numpy arrays. - :param infer_results: A dictionary to which the results of asynchronous inference will be added. - :param request_id: An identifier for the inference request, used to track the order of completion. - :param timeout: The maximum time (in seconds) to wait for the inference to complete. Defaults to 10 seconds. - :param retries: The maximum number of requests in case of failure - :yield: None, this is to separate async clien infer from checking the result - """ - batch_outputs = self.__get_batch_outputs(self.model_outputs.keys()) - batch_inputs = self.__get_batch_inputs(data) - - for i in range(retries): - if i > 0: # need to yield first, before doing sth, but only after first time - yield - if isinstance(infer_results.get(request_id), InferResult): - break - self.client.async_infer( - model_name=self.model_name, - request_id=str(request_id), - inputs=batch_inputs, - callback=partial(self.__async_callback, infer_results, request_id), - outputs=batch_outputs, - client_timeout=timeout, - ) - - def predict( - self, data: Union[Dict[str, np.ndarray], pd.DataFrame, Spectra], _async: bool = True, debug=False - ) -> Dict[str, np.ndarray]: + def predict(self, data: Union[Dict[str, np.ndarray], pd.DataFrame, Spectra], **kwargs) -> Dict[str, np.ndarray]: """ Perform inference on the given data using the Koina model. @@ -449,9 +35,7 @@ def predict( :param data: A dictionary or dataframe containing input data for inference. For the dictionary, keys are input names, and values are numpy arrays. In case of a dataframe, the input fields for the requested model must be present in the column names. - :param _async: If True, perform asynchronous inference; if False, perform sequential inference. Defaults to True. - :param debug: If True and using _async mode, store raw InferResult / InferServerException dictionary for later analysis. - + :param kwargs: Additional params that are forwarded to super().predict :return: A dictionary containing the model's predictions. Keys are output names, and values are numpy arrays representing the model's output. @@ -473,88 +57,4 @@ def predict( input_field: data[alternative_column_map[input_field]].to_numpy() for input_field in self.model_inputs.keys() } - if _async: - return self.__predict_async(data, debug=debug) - else: - return self.__predict_sequential(data) - - def __predict_async(self, data: Dict[str, np.ndarray], debug=False) -> Dict[str, np.ndarray]: - """ - Perform asynchronous inference on the given data using the Koina model. - - This method performs asynchronous inference on the provided input data using the configured Koina model. - Asynchronous inference allows for parallel processing of input data, potentially leading to faster results. - The method will return when all asynchronous inference tasks are complete. Note: Ensure that the model and server - are properly configured and that the input data matches the model's input requirements. - - :param data: A dictionary containing input data for inference. Keys are input names, and values are numpy arrays. - :param debug: If True, store raw InferResult / InferServerException dictionary for later analysis. - - :return: A dictionary containing the model's predictions. Keys are output names, and values are numpy arrays - representing the model's output. - """ - infer_results: Dict[int, Union[Dict[str, np.ndarray], InferenceServerException]] = {} - tasks = [] - for i, data_batch in enumerate(self.__slice_dict(data, self.batchsize)): - tasks.append(self.__async_predict_batch(data_batch, infer_results, request_id=i, retries=3)) - next(tasks[i]) - - n_tasks = i + 1 - with tqdm(total=n_tasks, desc="Getting predictions", disable=self.disable_progress_bar) as pbar: - unfinished_tasks = [i for i in range(n_tasks)] - while pbar.n < n_tasks: - time.sleep(0.5) - new_unfinished_tasks = [] - for j in unfinished_tasks: - result = infer_results.get(j) - if result is None: - new_unfinished_tasks.append(j) - elif isinstance(result, dict): - pbar.n += 1 - else: # unexpected result / exception -> try again - try: - del infer_results[j] - next(tasks[j]) - logger.warning(f"Unexpected response for batch {j}. Retrying...") - new_unfinished_tasks.append(j) - except StopIteration: - logger.error(f"Unexpected response for batch {j}. Max retries exceeded. Stopping.") - pbar.n += 1 - infer_results[j] = result - - unfinished_tasks = new_unfinished_tasks - pbar.refresh() - - return self.__handle_results(infer_results, debug) - - def __handle_results( - self, infer_results: Dict[int, Union[Dict[str, np.ndarray], InferenceServerException]], debug: bool - ) -> Dict[str, np.ndarray]: - """ - Handles the results. - - :param infer_results: The dictionary containing the inferred results - :param debug: whether to store the infer_results in the response_dict attribute - - :raises InferenceServerException: If at least one batch of predictions could not be inferred. - - :return: A dictionary containing the model's predictions. Keys are output names, and values are numpy arrays - representing the model's output. - """ - if debug: - self._response_dict = infer_results - try: - # sort according to request id - infer_results_to_return = [infer_results[i] for i in range(len(infer_results))] - return self.__merge_list_dict_array(infer_results_to_return) - except AttributeError: - for res in infer_results.values(): - if isinstance(res, InferenceServerException): - warnings.warn(res.message(), stacklevel=1) - else: - raise InferenceServerException( - """ - At least one request failed. Check the error message above and try again. - To get a list of responses run koina.predict(..., debug = True), then call koina.response_dict - """ - ) from None + return super().predict(inputs=data, **kwargs) diff --git a/poetry.lock b/poetry.lock index b6e20de..e585b4d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -13,13 +13,13 @@ files = [ [[package]] name = "aiohappyeyeballs" -version = "2.3.5" +version = "2.3.6" description = "Happy Eyeballs for asyncio" optional = true python-versions = ">=3.8" files = [ - {file = "aiohappyeyeballs-2.3.5-py3-none-any.whl", hash = "sha256:4d6dea59215537dbc746e93e779caea8178c866856a721c9c660d7a5a7b8be03"}, - {file = "aiohappyeyeballs-2.3.5.tar.gz", hash = "sha256:6fa48b9f1317254f122a07a131a86b71ca6946ca989ce6326fff54a99a920105"}, + {file = "aiohappyeyeballs-2.3.6-py3-none-any.whl", hash = "sha256:15dca2611fa78442f1cb54cf07ffb998573f2b4fbeab45ca8554c045665c896b"}, + {file = "aiohappyeyeballs-2.3.6.tar.gz", hash = "sha256:88211068d2a40e0436033956d7de3926ff36d54776f8b1022d6b21320cadae79"}, ] [[package]] @@ -233,6 +233,17 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "appnope" +version = "0.1.4" +description = "Disable App Nap on macOS >= 10.9" +optional = true +python-versions = ">=3.6" +files = [ + {file = "appnope-0.1.4-py2.py3-none-any.whl", hash = "sha256:502575ee11cd7a28c0205f379b525beefebab9d161b7c964670864014ed7213c"}, + {file = "appnope-0.1.4.tar.gz", hash = "sha256:1de3860566df9caf38f01f86f65e0e13e379af54f9e4bee1e66b48f2efffd1ee"}, +] + [[package]] name = "array-api-compat" version = "1.7.1" @@ -252,6 +263,24 @@ numpy = ["numpy"] pytorch = ["pytorch"] sparse = ["sparse (>=0.15.1)"] +[[package]] +name = "asttokens" +version = "2.4.1" +description = "Annotate AST trees with source code positions" +optional = true +python-versions = "*" +files = [ + {file = "asttokens-2.4.1-py2.py3-none-any.whl", hash = "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24"}, + {file = "asttokens-2.4.1.tar.gz", hash = "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0"}, +] + +[package.dependencies] +six = ">=1.12.0" + +[package.extras] +astroid = ["astroid (>=1,<2)", "astroid (>=2,<4)"] +test = ["astroid (>=1,<2)", "astroid (>=2,<4)", "pytest"] + [[package]] name = "astunparse" version = "1.6.3" @@ -681,6 +710,23 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "comm" +version = "0.2.2" +description = "Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc." +optional = true +python-versions = ">=3.8" +files = [ + {file = "comm-0.2.2-py3-none-any.whl", hash = "sha256:e6fb86cb70ff661ee8c9c14e7d36d6de3b4066f1441be4063df9c5009f0a64d3"}, + {file = "comm-0.2.2.tar.gz", hash = "sha256:3fd7a84065306e07bea1773df6eb8282de51ba82f77c72f9c85716ab11fe980e"}, +] + +[package.dependencies] +traitlets = ">=4" + +[package.extras] +test = ["pytest"] + [[package]] name = "contourpy" version = "1.2.1" @@ -908,27 +954,26 @@ files = [ [[package]] name = "datasets" -version = "2.20.0" +version = "2.21.0" description = "HuggingFace community-driven open-source library of datasets" optional = true python-versions = ">=3.8.0" files = [ - {file = "datasets-2.20.0-py3-none-any.whl", hash = "sha256:76ac02e3bdfff824492e20678f0b6b1b6d080515957fe834b00c2ba8d6b18e5e"}, - {file = "datasets-2.20.0.tar.gz", hash = "sha256:3c4dbcd27e0f642b9d41d20ff2efa721a5e04b32b2ca4009e0fc9139e324553f"}, + {file = "datasets-2.21.0-py3-none-any.whl", hash = "sha256:25e4e097110ce28824b746a107727ada94024cba11db8bc588d468414692b65a"}, + {file = "datasets-2.21.0.tar.gz", hash = "sha256:998f85a8460f1bd982e5bd058f8a0808eef424249e3df1e8cdd594ccd0dc8ba2"}, ] [package.dependencies] aiohttp = "*" dill = ">=0.3.0,<0.3.9" filelock = "*" -fsspec = {version = ">=2023.1.0,<=2024.5.0", extras = ["http"]} +fsspec = {version = ">=2023.1.0,<=2024.6.1", extras = ["http"]} huggingface-hub = ">=0.21.2" multiprocess = "*" numpy = ">=1.17" packaging = "*" pandas = "*" pyarrow = ">=15.0.0" -pyarrow-hotfix = "*" pyyaml = ">=5.1" requests = ">=2.32.2" tqdm = ">=4.66.3" @@ -936,20 +981,52 @@ xxhash = "*" [package.extras] apache-beam = ["apache-beam (>=2.26.0)"] -audio = ["librosa", "soundfile (>=0.12.1)"] +audio = ["librosa", "soundfile (>=0.12.1)", "soxr (>=0.4.0)"] benchmarks = ["tensorflow (==2.12.0)", "torch (==2.0.1)", "transformers (==4.30.1)"] -dev = ["Pillow (>=9.4.0)", "absl-py", "elasticsearch (<8.0.0)", "faiss-cpu (>=1.6.4)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "ruff (>=0.3.0)", "s3fs", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "sqlalchemy", "tensorflow (>=2.6.0)", "tiktoken", "torch", "torch (>=2.0.0)", "transformers", "typing-extensions (>=4.6.1)", "zstandard"] +dev = ["Pillow (>=9.4.0)", "absl-py", "decorator", "elasticsearch (<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "ruff (>=0.3.0)", "s3fs", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch", "torch (>=2.0.0)", "transformers", "transformers (>=4.42.0)", "typing-extensions (>=4.6.1)", "zstandard"] docs = ["s3fs", "tensorflow (>=2.6.0)", "torch", "transformers"] jax = ["jax (>=0.3.14)", "jaxlib (>=0.3.14)"] -metrics-tests = ["Werkzeug (>=1.0.1)", "accelerate", "bert-score (>=0.3.6)", "jiwer", "langdetect", "mauve-text", "nltk", "requests-file (>=1.5.1)", "rouge-score", "sacrebleu", "sacremoses", "scikit-learn", "scipy", "sentencepiece", "seqeval", "six (>=1.15.0,<1.16.0)", "spacy (>=3.0.0)", "texttable (>=1.6.3)", "tldextract", "tldextract (>=3.1.0)", "toml (>=0.10.1)", "typer (<0.5.0)"] +metrics-tests = ["Werkzeug (>=1.0.1)", "accelerate", "bert-score (>=0.3.6)", "jiwer", "langdetect", "mauve-text", "nltk (<3.8.2)", "requests-file (>=1.5.1)", "rouge-score", "sacrebleu", "sacremoses", "scikit-learn", "scipy", "sentencepiece", "seqeval", "six (>=1.15.0,<1.16.0)", "spacy (>=3.0.0)", "texttable (>=1.6.3)", "tldextract", "tldextract (>=3.1.0)", "toml (>=0.10.1)", "typer (<0.5.0)"] quality = ["ruff (>=0.3.0)"] s3 = ["s3fs"] tensorflow = ["tensorflow (>=2.6.0)"] tensorflow-gpu = ["tensorflow (>=2.6.0)"] -tests = ["Pillow (>=9.4.0)", "absl-py", "elasticsearch (<8.0.0)", "faiss-cpu (>=1.6.4)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "sqlalchemy", "tensorflow (>=2.6.0)", "tiktoken", "torch (>=2.0.0)", "transformers", "typing-extensions (>=4.6.1)", "zstandard"] +tests = ["Pillow (>=9.4.0)", "absl-py", "decorator", "elasticsearch (<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch (>=2.0.0)", "transformers (>=4.42.0)", "typing-extensions (>=4.6.1)", "zstandard"] +tests-numpy2 = ["Pillow (>=9.4.0)", "absl-py", "decorator", "elasticsearch (<8.0.0)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tiktoken", "torch (>=2.0.0)", "typing-extensions (>=4.6.1)", "zstandard"] torch = ["torch"] vision = ["Pillow (>=9.4.0)"] +[[package]] +name = "debugpy" +version = "1.8.5" +description = "An implementation of the Debug Adapter Protocol for Python" +optional = true +python-versions = ">=3.8" +files = [ + {file = "debugpy-1.8.5-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:7e4d594367d6407a120b76bdaa03886e9eb652c05ba7f87e37418426ad2079f7"}, + {file = "debugpy-1.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4413b7a3ede757dc33a273a17d685ea2b0c09dbd312cc03f5534a0fd4d40750a"}, + {file = "debugpy-1.8.5-cp310-cp310-win32.whl", hash = "sha256:dd3811bd63632bb25eda6bd73bea8e0521794cda02be41fa3160eb26fc29e7ed"}, + {file = "debugpy-1.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:b78c1250441ce893cb5035dd6f5fc12db968cc07f91cc06996b2087f7cefdd8e"}, + {file = "debugpy-1.8.5-cp311-cp311-macosx_12_0_universal2.whl", hash = "sha256:606bccba19f7188b6ea9579c8a4f5a5364ecd0bf5a0659c8a5d0e10dcee3032a"}, + {file = "debugpy-1.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db9fb642938a7a609a6c865c32ecd0d795d56c1aaa7a7a5722d77855d5e77f2b"}, + {file = "debugpy-1.8.5-cp311-cp311-win32.whl", hash = "sha256:4fbb3b39ae1aa3e5ad578f37a48a7a303dad9a3d018d369bc9ec629c1cfa7408"}, + {file = "debugpy-1.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:345d6a0206e81eb68b1493ce2fbffd57c3088e2ce4b46592077a943d2b968ca3"}, + {file = "debugpy-1.8.5-cp312-cp312-macosx_12_0_universal2.whl", hash = "sha256:5b5c770977c8ec6c40c60d6f58cacc7f7fe5a45960363d6974ddb9b62dbee156"}, + {file = "debugpy-1.8.5-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0a65b00b7cdd2ee0c2cf4c7335fef31e15f1b7056c7fdbce9e90193e1a8c8cb"}, + {file = "debugpy-1.8.5-cp312-cp312-win32.whl", hash = "sha256:c9f7c15ea1da18d2fcc2709e9f3d6de98b69a5b0fff1807fb80bc55f906691f7"}, + {file = "debugpy-1.8.5-cp312-cp312-win_amd64.whl", hash = "sha256:28ced650c974aaf179231668a293ecd5c63c0a671ae6d56b8795ecc5d2f48d3c"}, + {file = "debugpy-1.8.5-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:3df6692351172a42af7558daa5019651f898fc67450bf091335aa8a18fbf6f3a"}, + {file = "debugpy-1.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1cd04a73eb2769eb0bfe43f5bfde1215c5923d6924b9b90f94d15f207a402226"}, + {file = "debugpy-1.8.5-cp38-cp38-win32.whl", hash = "sha256:8f913ee8e9fcf9d38a751f56e6de12a297ae7832749d35de26d960f14280750a"}, + {file = "debugpy-1.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:a697beca97dad3780b89a7fb525d5e79f33821a8bc0c06faf1f1289e549743cf"}, + {file = "debugpy-1.8.5-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:0a1029a2869d01cb777216af8c53cda0476875ef02a2b6ff8b2f2c9a4b04176c"}, + {file = "debugpy-1.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e84c276489e141ed0b93b0af648eef891546143d6a48f610945416453a8ad406"}, + {file = "debugpy-1.8.5-cp39-cp39-win32.whl", hash = "sha256:ad84b7cde7fd96cf6eea34ff6c4a1b7887e0fe2ea46e099e53234856f9d99a34"}, + {file = "debugpy-1.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:7b0fe36ed9d26cb6836b0a51453653f8f2e347ba7348f2bbfe76bfeb670bfb1c"}, + {file = "debugpy-1.8.5-py2.py3-none-any.whl", hash = "sha256:55919dce65b471eff25901acf82d328bbd5b833526b6c1364bd5133754777a44"}, + {file = "debugpy-1.8.5.zip", hash = "sha256:b2112cfeb34b4507399d298fe7023a16656fc553ed5246536060ca7bd0e668d0"}, +] + [[package]] name = "decorator" version = "5.1.1" @@ -1010,6 +1087,7 @@ develop = false [package.dependencies] datasets = "*" fpdf = "*" +ipykernel = {version = "*", optional = true, markers = "extra == \"rltl-report\""} matplotlib = "*" nbconvert = {version = "*", optional = true, markers = "extra == \"rltl-report\""} numpy = "*" @@ -1023,14 +1101,14 @@ wandb = {version = ">=0.15", optional = true, markers = "extra == \"wandb\""} [package.extras] dev = ["black", "pylint", "pytest (>=3.7)", "pytest-cov", "setuptools", "twine", "wheel"] -rltl-report = ["nbconvert"] +rltl-report = ["ipykernel", "nbconvert"] wandb = ["wandb (>=0.15)"] [package.source] type = "git" url = "git@github.com:wilhelm-lab/dlomix.git" reference = "feature/bmpc" -resolved_reference = "5b3924102ed2ec7f66a4ac09cf0fd71c285c08bf" +resolved_reference = "90d57a01e464607bab825ded4da122f52ee7a5bf" [[package]] name = "dm-tree" @@ -1158,6 +1236,20 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "executing" +version = "2.0.1" +description = "Get the currently executing AST node of a frame, and other information" +optional = true +python-versions = ">=3.5" +files = [ + {file = "executing-2.0.1-py2.py3-none-any.whl", hash = "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc"}, + {file = "executing-2.0.1.tar.gz", hash = "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147"}, +] + +[package.extras] +tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] + [[package]] name = "fastjsonschema" version = "2.20.0" @@ -1445,13 +1537,13 @@ files = [ [[package]] name = "fsspec" -version = "2024.5.0" +version = "2024.6.1" description = "File-system specification" optional = true python-versions = ">=3.8" files = [ - {file = "fsspec-2024.5.0-py3-none-any.whl", hash = "sha256:e0fdbc446d67e182f49a70b82cf7889028a63588fde6b222521f10937b2b670c"}, - {file = "fsspec-2024.5.0.tar.gz", hash = "sha256:1d021b0b0f933e3b3029ed808eb400c08ba101ca2de4b3483fbc9ca23fcee94a"}, + {file = "fsspec-2024.6.1-py3-none-any.whl", hash = "sha256:3cb443f8bcd2efb31295a5b9fdb02aee81d8452c80d28f97a6d0959e6cee101e"}, + {file = "fsspec-2024.6.1.tar.gz", hash = "sha256:fad7d7e209dd4c1208e3bbfda706620e0da5142bebbd9c384afb95b07e798e49"}, ] [package.dependencies] @@ -1463,6 +1555,7 @@ adl = ["adlfs"] arrow = ["pyarrow (>=1)"] dask = ["dask", "distributed"] dev = ["pre-commit", "ruff"] +doc = ["numpydoc", "sphinx", "sphinx-design", "sphinx-rtd-theme", "yarl"] dropbox = ["dropbox", "dropboxdrivefs", "requests"] full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"] fuse = ["fusepy"] @@ -1776,21 +1869,21 @@ test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "p [[package]] name = "importlib-resources" -version = "6.4.0" +version = "6.4.2" description = "Read resources from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_resources-6.4.0-py3-none-any.whl", hash = "sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c"}, - {file = "importlib_resources-6.4.0.tar.gz", hash = "sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145"}, + {file = "importlib_resources-6.4.2-py3-none-any.whl", hash = "sha256:8bba8c54a8a3afaa1419910845fa26ebd706dc716dd208d9b158b4b6966f5c5c"}, + {file = "importlib_resources-6.4.2.tar.gz", hash = "sha256:6cbfbefc449cc6e2095dd184691b7a12a04f40bc75dd4c55d31c34f174cdf57a"}, ] [package.dependencies] zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["jaraco.test (>=5.4)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] [[package]] name = "iniconfig" @@ -1803,6 +1896,95 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "ipykernel" +version = "6.29.5" +description = "IPython Kernel for Jupyter" +optional = true +python-versions = ">=3.8" +files = [ + {file = "ipykernel-6.29.5-py3-none-any.whl", hash = "sha256:afdb66ba5aa354b09b91379bac28ae4afebbb30e8b39510c9690afb7a10421b5"}, + {file = "ipykernel-6.29.5.tar.gz", hash = "sha256:f093a22c4a40f8828f8e330a9c297cb93dcab13bd9678ded6de8e5cf81c56215"}, +] + +[package.dependencies] +appnope = {version = "*", markers = "platform_system == \"Darwin\""} +comm = ">=0.1.1" +debugpy = ">=1.6.5" +ipython = ">=7.23.1" +jupyter-client = ">=6.1.12" +jupyter-core = ">=4.12,<5.0.dev0 || >=5.1.dev0" +matplotlib-inline = ">=0.1" +nest-asyncio = "*" +packaging = "*" +psutil = "*" +pyzmq = ">=24" +tornado = ">=6.1" +traitlets = ">=5.4.0" + +[package.extras] +cov = ["coverage[toml]", "curio", "matplotlib", "pytest-cov", "trio"] +docs = ["myst-parser", "pydata-sphinx-theme", "sphinx", "sphinx-autodoc-typehints", "sphinxcontrib-github-alt", "sphinxcontrib-spelling", "trio"] +pyqt5 = ["pyqt5"] +pyside6 = ["pyside6"] +test = ["flaky", "ipyparallel", "pre-commit", "pytest (>=7.0)", "pytest-asyncio (>=0.23.5)", "pytest-cov", "pytest-timeout"] + +[[package]] +name = "ipython" +version = "8.18.1" +description = "IPython: Productive Interactive Computing" +optional = true +python-versions = ">=3.9" +files = [ + {file = "ipython-8.18.1-py3-none-any.whl", hash = "sha256:e8267419d72d81955ec1177f8a29aaa90ac80ad647499201119e2f05e99aa397"}, + {file = "ipython-8.18.1.tar.gz", hash = "sha256:ca6f079bb33457c66e233e4580ebfc4128855b4cf6370dddd73842a9563e8a27"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +decorator = "*" +exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} +jedi = ">=0.16" +matplotlib-inline = "*" +pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""} +prompt-toolkit = ">=3.0.41,<3.1.0" +pygments = ">=2.4.0" +stack-data = "*" +traitlets = ">=5" +typing-extensions = {version = "*", markers = "python_version < \"3.10\""} + +[package.extras] +all = ["black", "curio", "docrepr", "exceptiongroup", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] +black = ["black"] +doc = ["docrepr", "exceptiongroup", "ipykernel", "matplotlib", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "typing-extensions"] +kernel = ["ipykernel"] +nbconvert = ["nbconvert"] +nbformat = ["nbformat"] +notebook = ["ipywidgets", "notebook"] +parallel = ["ipyparallel"] +qtconsole = ["qtconsole"] +test = ["pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath"] +test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath", "trio"] + +[[package]] +name = "jedi" +version = "0.19.1" +description = "An autocompletion tool for Python that can be used for text editors." +optional = true +python-versions = ">=3.6" +files = [ + {file = "jedi-0.19.1-py2.py3-none-any.whl", hash = "sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0"}, + {file = "jedi-0.19.1.tar.gz", hash = "sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd"}, +] + +[package.dependencies] +parso = ">=0.8.3,<0.9.0" + +[package.extras] +docs = ["Jinja2 (==2.11.3)", "MarkupSafe (==1.1.1)", "Pygments (==2.8.1)", "alabaster (==0.7.12)", "babel (==2.9.1)", "chardet (==4.0.0)", "commonmark (==0.8.1)", "docutils (==0.17.1)", "future (==0.18.2)", "idna (==2.10)", "imagesize (==1.2.0)", "mock (==1.0.1)", "packaging (==20.9)", "pyparsing (==2.4.7)", "pytz (==2021.1)", "readthedocs-sphinx-ext (==2.1.4)", "recommonmark (==0.5.0)", "requests (==2.25.1)", "six (==1.15.0)", "snowballstemmer (==2.1.0)", "sphinx (==1.8.5)", "sphinx-rtd-theme (==0.4.3)", "sphinxcontrib-serializinghtml (==1.1.4)", "sphinxcontrib-websupport (==1.2.4)", "urllib3 (==1.26.4)"] +qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] +testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] + [[package]] name = "jinja2" version = "3.1.4" @@ -2058,6 +2240,22 @@ files = [ {file = "kiwisolver-1.4.5.tar.gz", hash = "sha256:e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec"}, ] +[[package]] +name = "koinapy" +version = "0.0.7" +description = "Python client to communicate with Koina." +optional = false +python-versions = "<3.13,>=3.8" +files = [ + {file = "koinapy-0.0.7-py3-none-any.whl", hash = "sha256:2c76de08f70ada30f28cbdbe51ac04c2a8853b015e356c7d530559194db90632"}, + {file = "koinapy-0.0.7.tar.gz", hash = "sha256:62796fb2efbd933012b10fec8a665e3a61a1b1a3dcb6afda427da54f0aac8ee8"}, +] + +[package.dependencies] +pandas = "*" +tqdm = "*" +tritonclient = {version = ">=2.23,<2.41 || >2.41", extras = ["grpc"], markers = "python_version >= \"3.8\" and python_version < \"3.11\""} + [[package]] name = "libclang" version = "18.1.1" @@ -2393,40 +2591,51 @@ tests = ["pytest", "pytz", "simplejson"] [[package]] name = "matplotlib" -version = "3.9.1.post1" +version = "3.9.2" description = "Python plotting package" optional = false python-versions = ">=3.9" files = [ - {file = "matplotlib-3.9.1.post1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3779ad3e8b72df22b8a622c5796bbcfabfa0069b835412e3c1dec8ee3de92d0c"}, - {file = "matplotlib-3.9.1.post1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ec400340f8628e8e2260d679078d4e9b478699f386e5cc8094e80a1cb0039c7c"}, - {file = "matplotlib-3.9.1.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82c18791b8862ea095081f745b81f896b011c5a5091678fb33204fef641476af"}, - {file = "matplotlib-3.9.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:621a628389c09a6b9f609a238af8e66acecece1cfa12febc5fe4195114ba7446"}, - {file = "matplotlib-3.9.1.post1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:9a54734ca761ebb27cd4f0b6c2ede696ab6861052d7d7e7b8f7a6782665115f5"}, - {file = "matplotlib-3.9.1.post1-cp310-cp310-win_amd64.whl", hash = "sha256:0721f93db92311bb514e446842e2b21c004541dcca0281afa495053e017c5458"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:b08b46058fe2a31ecb81ef6aa3611f41d871f6a8280e9057cb4016cb3d8e894a"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:22b344e84fcc574f561b5731f89a7625db8ef80cdbb0026a8ea855a33e3429d1"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b49fee26d64aefa9f061b575f0f7b5fc4663e51f87375c7239efa3d30d908fa"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89eb7e89e2b57856533c5c98f018aa3254fa3789fcd86d5f80077b9034a54c9a"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c06e742bade41fda6176d4c9c78c9ea016e176cd338e62a1686384cb1eb8de41"}, - {file = "matplotlib-3.9.1.post1-cp311-cp311-win_amd64.whl", hash = "sha256:c44edab5b849e0fc1f1c9d6e13eaa35ef65925f7be45be891d9784709ad95561"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:bf28b09986aee06393e808e661c3466be9c21eff443c9bc881bce04bfbb0c500"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:92aeb8c439d4831510d8b9d5e39f31c16c7f37873879767c26b147cef61e54cd"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f15798b0691b45c80d3320358a88ce5a9d6f518b28575b3ea3ed31b4bd95d009"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d59fc6096da7b9c1df275f9afc3fef5cbf634c21df9e5f844cba3dd8deb1847d"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ab986817a32a70ce22302438691e7df4c6ee4a844d47289db9d583d873491e0b"}, - {file = "matplotlib-3.9.1.post1-cp312-cp312-win_amd64.whl", hash = "sha256:0d78e7d2d86c4472da105d39aba9b754ed3dfeaeaa4ac7206b82706e0a5362fa"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:bd07eba6431b4dc9253cce6374a28c415e1d3a7dc9f8aba028ea7592f06fe172"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ca230cc4482010d646827bd2c6d140c98c361e769ae7d954ebf6fff2a226f5b1"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ace27c0fdeded399cbc43f22ffa76e0f0752358f5b33106ec7197534df08725a"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a4f3aeb7ba14c497dc6f021a076c48c2e5fbdf3da1e7264a5d649683e284a2f"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:23f96fbd4ff4cfa9b8a6b685a65e7eb3c2ced724a8d965995ec5c9c2b1f7daf5"}, - {file = "matplotlib-3.9.1.post1-cp39-cp39-win_amd64.whl", hash = "sha256:2808b95452b4ffa14bfb7c7edffc5350743c31bda495f0d63d10fdd9bc69e895"}, - {file = "matplotlib-3.9.1.post1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:ffc91239f73b4179dec256b01299d46d0ffa9d27d98494bc1476a651b7821cbe"}, - {file = "matplotlib-3.9.1.post1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:f965ebca9fd4feaaca45937c4849d92b70653057497181100fcd1e18161e5f29"}, - {file = "matplotlib-3.9.1.post1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:801ee9323fd7b2da0d405aebbf98d1da77ea430bbbbbec6834c0b3af15e5db44"}, - {file = "matplotlib-3.9.1.post1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:50113e9b43ceb285739f35d43db36aa752fb8154325b35d134ff6e177452f9ec"}, - {file = "matplotlib-3.9.1.post1.tar.gz", hash = "sha256:c91e585c65092c975a44dc9d4239ba8c594ba3c193d7c478b6d178c4ef61f406"}, + {file = "matplotlib-3.9.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:9d78bbc0cbc891ad55b4f39a48c22182e9bdaea7fc0e5dbd364f49f729ca1bbb"}, + {file = "matplotlib-3.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c375cc72229614632c87355366bdf2570c2dac01ac66b8ad048d2dabadf2d0d4"}, + {file = "matplotlib-3.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d94ff717eb2bd0b58fe66380bd8b14ac35f48a98e7c6765117fe67fb7684e64"}, + {file = "matplotlib-3.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab68d50c06938ef28681073327795c5db99bb4666214d2d5f880ed11aeaded66"}, + {file = "matplotlib-3.9.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:65aacf95b62272d568044531e41de26285d54aec8cb859031f511f84bd8b495a"}, + {file = "matplotlib-3.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:3fd595f34aa8a55b7fc8bf9ebea8aa665a84c82d275190a61118d33fbc82ccae"}, + {file = "matplotlib-3.9.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d8dd059447824eec055e829258ab092b56bb0579fc3164fa09c64f3acd478772"}, + {file = "matplotlib-3.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c797dac8bb9c7a3fd3382b16fe8f215b4cf0f22adccea36f1545a6d7be310b41"}, + {file = "matplotlib-3.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d719465db13267bcef19ea8954a971db03b9f48b4647e3860e4bc8e6ed86610f"}, + {file = "matplotlib-3.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8912ef7c2362f7193b5819d17dae8629b34a95c58603d781329712ada83f9447"}, + {file = "matplotlib-3.9.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7741f26a58a240f43bee74965c4882b6c93df3e7eb3de160126d8c8f53a6ae6e"}, + {file = "matplotlib-3.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:ae82a14dab96fbfad7965403c643cafe6515e386de723e498cf3eeb1e0b70cc7"}, + {file = "matplotlib-3.9.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:ac43031375a65c3196bee99f6001e7fa5bdfb00ddf43379d3c0609bdca042df9"}, + {file = "matplotlib-3.9.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:be0fc24a5e4531ae4d8e858a1a548c1fe33b176bb13eff7f9d0d38ce5112a27d"}, + {file = "matplotlib-3.9.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf81de2926c2db243c9b2cbc3917619a0fc85796c6ba4e58f541df814bbf83c7"}, + {file = "matplotlib-3.9.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6ee45bc4245533111ced13f1f2cace1e7f89d1c793390392a80c139d6cf0e6c"}, + {file = "matplotlib-3.9.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:306c8dfc73239f0e72ac50e5a9cf19cc4e8e331dd0c54f5e69ca8758550f1e1e"}, + {file = "matplotlib-3.9.2-cp312-cp312-win_amd64.whl", hash = "sha256:5413401594cfaff0052f9d8b1aafc6d305b4bd7c4331dccd18f561ff7e1d3bd3"}, + {file = "matplotlib-3.9.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:18128cc08f0d3cfff10b76baa2f296fc28c4607368a8402de61bb3f2eb33c7d9"}, + {file = "matplotlib-3.9.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4876d7d40219e8ae8bb70f9263bcbe5714415acfdf781086601211335e24f8aa"}, + {file = "matplotlib-3.9.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6d9f07a80deab4bb0b82858a9e9ad53d1382fd122be8cde11080f4e7dfedb38b"}, + {file = "matplotlib-3.9.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7c0410f181a531ec4e93bbc27692f2c71a15c2da16766f5ba9761e7ae518413"}, + {file = "matplotlib-3.9.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:909645cce2dc28b735674ce0931a4ac94e12f5b13f6bb0b5a5e65e7cea2c192b"}, + {file = "matplotlib-3.9.2-cp313-cp313-win_amd64.whl", hash = "sha256:f32c7410c7f246838a77d6d1eff0c0f87f3cb0e7c4247aebea71a6d5a68cab49"}, + {file = "matplotlib-3.9.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:37e51dd1c2db16ede9cfd7b5cabdfc818b2c6397c83f8b10e0e797501c963a03"}, + {file = "matplotlib-3.9.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b82c5045cebcecd8496a4d694d43f9cc84aeeb49fe2133e036b207abe73f4d30"}, + {file = "matplotlib-3.9.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f053c40f94bc51bc03832a41b4f153d83f2062d88c72b5e79997072594e97e51"}, + {file = "matplotlib-3.9.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbe196377a8248972f5cede786d4c5508ed5f5ca4a1e09b44bda889958b33f8c"}, + {file = "matplotlib-3.9.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:5816b1e1fe8c192cbc013f8f3e3368ac56fbecf02fb41b8f8559303f24c5015e"}, + {file = "matplotlib-3.9.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:cef2a73d06601437be399908cf13aee74e86932a5ccc6ccdf173408ebc5f6bb2"}, + {file = "matplotlib-3.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e0830e188029c14e891fadd99702fd90d317df294c3298aad682739c5533721a"}, + {file = "matplotlib-3.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ba9c1299c920964e8d3857ba27173b4dbb51ca4bab47ffc2c2ba0eb5e2cbc5"}, + {file = "matplotlib-3.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1cd93b91ab47a3616b4d3c42b52f8363b88ca021e340804c6ab2536344fad9ca"}, + {file = "matplotlib-3.9.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6d1ce5ed2aefcdce11904fc5bbea7d9c21fff3d5f543841edf3dea84451a09ea"}, + {file = "matplotlib-3.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:b2696efdc08648536efd4e1601b5fd491fd47f4db97a5fbfd175549a7365c1b2"}, + {file = "matplotlib-3.9.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:d52a3b618cb1cbb769ce2ee1dcdb333c3ab6e823944e9a2d36e37253815f9556"}, + {file = "matplotlib-3.9.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:039082812cacd6c6bec8e17a9c1e6baca230d4116d522e81e1f63a74d01d2e21"}, + {file = "matplotlib-3.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6758baae2ed64f2331d4fd19be38b7b4eae3ecec210049a26b6a4f3ae1c85dcc"}, + {file = "matplotlib-3.9.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:050598c2b29e0b9832cde72bcf97627bf00262adbc4a54e2b856426bb2ef0697"}, + {file = "matplotlib-3.9.2.tar.gz", hash = "sha256:96ab43906269ca64a6366934106fa01534454a69e471b7bf3d79083981aaab92"}, ] [package.dependencies] @@ -2444,6 +2653,20 @@ python-dateutil = ">=2.7" [package.extras] dev = ["meson-python (>=0.13.1)", "numpy (>=1.25)", "pybind11 (>=2.6)", "setuptools (>=64)", "setuptools_scm (>=7)"] +[[package]] +name = "matplotlib-inline" +version = "0.1.7" +description = "Inline Matplotlib backend for Jupyter" +optional = true +python-versions = ">=3.8" +files = [ + {file = "matplotlib_inline-0.1.7-py3-none-any.whl", hash = "sha256:df192d39a4ff8f21b1895d72e6a13f5fcc5099f00fa84384e0ea28c2cc0653ca"}, + {file = "matplotlib_inline-0.1.7.tar.gz", hash = "sha256:8423b23ec666be3d16e16b60bdd8ac4e86e840ebd1dd11a30b9f117f2fa0ab90"}, +] + +[package.dependencies] +traitlets = "*" + [[package]] name = "mccabe" version = "0.7.0" @@ -2838,6 +3061,17 @@ traitlets = ">=5.1" docs = ["myst-parser", "pydata-sphinx-theme", "sphinx", "sphinxcontrib-github-alt", "sphinxcontrib-spelling"] test = ["pep440", "pre-commit", "pytest", "testpath"] +[[package]] +name = "nest-asyncio" +version = "1.6.0" +description = "Patch asyncio to allow nested event loops" +optional = true +python-versions = ">=3.5" +files = [ + {file = "nest_asyncio-1.6.0-py3-none-any.whl", hash = "sha256:87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c"}, + {file = "nest_asyncio-1.6.0.tar.gz", hash = "sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe"}, +] + [[package]] name = "nodeenv" version = "1.9.1" @@ -3202,6 +3436,21 @@ files = [ {file = "pandocfilters-1.5.1.tar.gz", hash = "sha256:002b4a555ee4ebc03f8b66307e287fa492e4a77b4ea14d3f934328297bb4939e"}, ] +[[package]] +name = "parso" +version = "0.8.4" +description = "A Python Parser" +optional = true +python-versions = ">=3.6" +files = [ + {file = "parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18"}, + {file = "parso-0.8.4.tar.gz", hash = "sha256:eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d"}, +] + +[package.extras] +qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] +testing = ["docopt", "pytest"] + [[package]] name = "pathspec" version = "0.12.1" @@ -3238,6 +3487,20 @@ files = [ [package.dependencies] flake8 = ">=5.0.0" +[[package]] +name = "pexpect" +version = "4.9.0" +description = "Pexpect allows easy control of interactive console applications." +optional = true +python-versions = "*" +files = [ + {file = "pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523"}, + {file = "pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f"}, +] + +[package.dependencies] +ptyprocess = ">=0.5" + [[package]] name = "pillow" version = "10.4.0" @@ -3399,6 +3662,20 @@ files = [ "ruamel.yaml" = ">=0.15" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +[[package]] +name = "prompt-toolkit" +version = "3.0.47" +description = "Library for building powerful interactive command lines in Python" +optional = true +python-versions = ">=3.7.0" +files = [ + {file = "prompt_toolkit-3.0.47-py3-none-any.whl", hash = "sha256:0d7bfa67001d5e39d02c224b663abc33687405033a8c422d0d675a5a13361d10"}, + {file = "prompt_toolkit-3.0.47.tar.gz", hash = "sha256:1e1b29cb58080b1e69f207c893a1a7bf16d127a5c30c9d17a25a5d77792e5360"}, +] + +[package.dependencies] +wcwidth = "*" + [[package]] name = "protobuf" version = "4.25.4" @@ -3448,6 +3725,31 @@ files = [ [package.extras] test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] +[[package]] +name = "ptyprocess" +version = "0.7.0" +description = "Run a subprocess in a pseudo terminal" +optional = true +python-versions = "*" +files = [ + {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, + {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, +] + +[[package]] +name = "pure-eval" +version = "0.2.3" +description = "Safely evaluate AST nodes without side effects" +optional = true +python-versions = "*" +files = [ + {file = "pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0"}, + {file = "pure_eval-0.2.3.tar.gz", hash = "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42"}, +] + +[package.extras] +tests = ["pytest"] + [[package]] name = "pyarrow" version = "17.0.0" @@ -3499,17 +3801,6 @@ numpy = ">=1.16.6" [package.extras] test = ["cffi", "hypothesis", "pandas", "pytest", "pytz"] -[[package]] -name = "pyarrow-hotfix" -version = "0.6" -description = "" -optional = true -python-versions = ">=3.5" -files = [ - {file = "pyarrow_hotfix-0.6-py3-none-any.whl", hash = "sha256:dcc9ae2d220dff0083be6a9aa8e0cdee5182ad358d4931fce825c545e5c89178"}, - {file = "pyarrow_hotfix-0.6.tar.gz", hash = "sha256:79d3e030f7ff890d408a100ac16d6f00b14d44a502d7897cd9fc3e3a534e9945"}, -] - [[package]] name = "pyasn1" version = "0.6.0" @@ -4760,13 +5051,13 @@ stats = ["scipy (>=1.7)", "statsmodels (>=0.12)"] [[package]] name = "sentry-sdk" -version = "2.12.0" +version = "2.13.0" description = "Python client for Sentry (https://sentry.io)" optional = true python-versions = ">=3.6" files = [ - {file = "sentry_sdk-2.12.0-py2.py3-none-any.whl", hash = "sha256:7a8d5163d2ba5c5f4464628c6b68f85e86972f7c636acc78aed45c61b98b7a5e"}, - {file = "sentry_sdk-2.12.0.tar.gz", hash = "sha256:8763840497b817d44c49b3fe3f5f7388d083f2337ffedf008b2cdb63b5c86dc6"}, + {file = "sentry_sdk-2.13.0-py2.py3-none-any.whl", hash = "sha256:6beede8fc2ab4043da7f69d95534e320944690680dd9a963178a49de71d726c6"}, + {file = "sentry_sdk-2.13.0.tar.gz", hash = "sha256:8d4a576f7a98eb2fdb40e13106e41f330e5c79d72a68be1316e7852cf4995260"}, ] [package.dependencies] @@ -4793,6 +5084,7 @@ httpx = ["httpx (>=0.16.0)"] huey = ["huey (>=2)"] huggingface-hub = ["huggingface-hub (>=0.22)"] langchain = ["langchain (>=0.0.210)"] +litestar = ["litestar (>=2.0.0)"] loguru = ["loguru (>=0.5)"] openai = ["openai (>=1.0.0)", "tiktoken (>=0.3.0)"] opentelemetry = ["opentelemetry-distro (>=0.35b0)"] @@ -4910,18 +5202,18 @@ test = ["pytest"] [[package]] name = "setuptools" -version = "72.1.0" +version = "72.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-72.1.0-py3-none-any.whl", hash = "sha256:5a03e1860cf56bb6ef48ce186b0e557fdba433237481a9a625176c2831be15d1"}, - {file = "setuptools-72.1.0.tar.gz", hash = "sha256:8d243eff56d095e5817f796ede6ae32941278f542e0f941867cc05ae52b162ec"}, + {file = "setuptools-72.2.0-py3-none-any.whl", hash = "sha256:f11dd94b7bae3a156a95ec151f24e4637fb4fa19c878e4d191bfb8b2d82728c4"}, + {file = "setuptools-72.2.0.tar.gz", hash = "sha256:80aacbf633704e9c8bfa1d99fa5dd4dc59573efcf9e4042c13d3bcef91ac2ef9"}, ] [package.extras] core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] @@ -4992,13 +5284,13 @@ files = [ [[package]] name = "soupsieve" -version = "2.5" +version = "2.6" description = "A modern CSS selector implementation for Beautiful Soup." optional = true python-versions = ">=3.8" files = [ - {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, - {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, + {file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"}, + {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, ] [[package]] @@ -5006,25 +5298,21 @@ name = "spectrum-fundamentals" version = "0.7.3" description = "Fundamental functions, annotation pipeline and constants for oktoberfest" optional = false -python-versions = ">=3.9.0,<3.11.0" -files = [] -develop = false +python-versions = "<3.11.0,>=3.9.0" +files = [ + {file = "spectrum_fundamentals-0.7.3-py3-none-any.whl", hash = "sha256:3c483a34150e6bcfc2800655b55b4c8e370c9fc8c9cf5f263cda556eece6fd40"}, + {file = "spectrum_fundamentals-0.7.3.tar.gz", hash = "sha256:100af7e8dad3776927429305ead808c1fb6941cd67f2ae9e2c2c1d7cdb5c73ba"}, +] [package.dependencies] click = ">=8.0.0" -joblib = "^1.0.1" -moepy = "^1.1.4" +joblib = ">=1.0.1,<2.0.0" +moepy = ">=1.1.4,<2.0.0" numpy = ">=1.24.1,<1.25" pandas = ">=1.3,<3.0" PyYAML = ">=5.4.1" rich = ">=10.3.0" -scikit-learn = "^1.0" - -[package.source] -type = "git" -url = "git@github.com:wilhelm-lab/spectrum_fundamentals.git" -reference = "development" -resolved_reference = "9a8c0ae19485e3130c25148aeddd5f760c62b781" +scikit-learn = ">=1.0,<2.0" [[package]] name = "spectrum-io" @@ -5272,6 +5560,25 @@ lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] standalone = ["Sphinx (>=5)"] test = ["pytest"] +[[package]] +name = "stack-data" +version = "0.6.3" +description = "Extract data from python stack frames and tracebacks for informative displays" +optional = true +python-versions = "*" +files = [ + {file = "stack_data-0.6.3-py3-none-any.whl", hash = "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695"}, + {file = "stack_data-0.6.3.tar.gz", hash = "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9"}, +] + +[package.dependencies] +asttokens = ">=2.1.0" +executing = ">=1.2.0" +pure-eval = "*" + +[package.extras] +tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] + [[package]] name = "starlette" version = "0.38.2" @@ -5813,13 +6120,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.30.5" +version = "0.30.6" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.30.5-py3-none-any.whl", hash = "sha256:b2d86de274726e9878188fa07576c9ceeff90a839e2b6e25c917fe05f5a6c835"}, - {file = "uvicorn-0.30.5.tar.gz", hash = "sha256:ac6fdbd4425c5fd17a9fe39daf4d4d075da6fdc80f653e5894cdc2fd98752bee"}, + {file = "uvicorn-0.30.6-py3-none-any.whl", hash = "sha256:65fd46fe3fda5bdc1b03b94eb634923ff18cd35b2f084813ea79d1f103f711b5"}, + {file = "uvicorn-0.30.6.tar.gz", hash = "sha256:4b15decdda1e72be08209e860a1e10e92439ad5b97cf44cc945fcbee66fc5788"}, ] [package.dependencies] @@ -5852,19 +6159,19 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [[package]] name = "wandb" -version = "0.17.6" +version = "0.17.7" description = "A CLI and library for interacting with the Weights & Biases API." optional = true python-versions = ">=3.7" files = [ - {file = "wandb-0.17.6-py3-none-any.whl", hash = "sha256:30c4f110d406368a4653fa137ad04e8ba0a68dee25836de55c3ca384b23e30c2"}, - {file = "wandb-0.17.6-py3-none-macosx_10_14_x86_64.whl", hash = "sha256:c554897b9b9a38490fa86d972975528b424daf5bcf35a5249ef2d25bf99986c2"}, - {file = "wandb-0.17.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4015215335b4cff6268342339022382a38a7e086a8388c8b52df53bc6f18f39a"}, - {file = "wandb-0.17.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d38c52fdd0add655e0c3d408d7d0a84a19ec559512b157b8d42e9f67d98b3004"}, - {file = "wandb-0.17.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86743223a5f0c76a5c5ebc5a077aaa87221545ff8f12ba754c51a0bc1fe1e67e"}, - {file = "wandb-0.17.6-py3-none-win32.whl", hash = "sha256:247b1c9677fd633a460201f421d4fd4f370e7243d06257fab0ad1bb728ddcc1c"}, - {file = "wandb-0.17.6-py3-none-win_amd64.whl", hash = "sha256:51954f993b372c20812616838302183f0e3abf137614f05d80c7c17c307bfff9"}, - {file = "wandb-0.17.6.tar.gz", hash = "sha256:416739f293d59b95bcb189ecbaeb19b3a74ff2b80d501a90b93e6b6f9435c017"}, + {file = "wandb-0.17.7-py3-none-any.whl", hash = "sha256:42f37d7d4f1934fc5a33233be1de0f0c8e3bbff04a4403b3ac6030e577cc84e1"}, + {file = "wandb-0.17.7-py3-none-macosx_10_14_x86_64.whl", hash = "sha256:ed3fcf51b533249db306a9dd41893d671eb936f64b8837ffc504dba56609ff47"}, + {file = "wandb-0.17.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f21183b74ed05744b274c7d876d473ae14a985becfbabd005104ce7e78200cf8"}, + {file = "wandb-0.17.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:011cca25b2ca57956d1ff2c84e31c903058cc8f552ecc1d0450ffad34c8a59bd"}, + {file = "wandb-0.17.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df335a67d3fff9299d915c127ad476cdf9e3f2b1d86e025f54ed63c7dab62d72"}, + {file = "wandb-0.17.7-py3-none-win32.whl", hash = "sha256:de7e040fe553e149926437ea2d24a20c6b563092e5a17709c4b99dff8a38470c"}, + {file = "wandb-0.17.7-py3-none-win_amd64.whl", hash = "sha256:c81be25cb1a5322aff95f66a89ca4abcb2a8e98ee09b8938f123a536b967a235"}, + {file = "wandb-0.17.7.tar.gz", hash = "sha256:4623fb7618ff094ebab91101b8b5dcef5b3513d35e867a10f64021ca427bb38d"}, ] [package.dependencies] @@ -5996,6 +6303,17 @@ files = [ [package.dependencies] anyio = ">=3.0.0" +[[package]] +name = "wcwidth" +version = "0.2.13" +description = "Measures the displayed width of unicode strings in a terminal" +optional = true +python-versions = "*" +files = [ + {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, + {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"}, +] + [[package]] name = "webencodings" version = "0.5.1" @@ -6470,4 +6788,4 @@ dlomix = ["dlomix", "tensorflow"] [metadata] lock-version = "2.0" python-versions = ">=3.9.0,<3.11.0" -content-hash = "7846ec4857956419a59c68084df96bcc3ab51105d5efbdfdc7c277b06f716917" +content-hash = "44479075556f499f9b2d0028dcee8d84a2ce1362bc90867fc0ec0b7f9b9c6501" diff --git a/pyproject.toml b/pyproject.toml index 1a64f71..6ba6c02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ tritonclient = {extras = ["grpc"], version = ">=2.47.0,<2.48"} dlomix = {extras = ["rltl-report", "wandb"], git = "git@github.com:wilhelm-lab/dlomix.git", branch = "feature/bmpc", optional = true} tensorflow = {version = ">=2.13,<2.16", extras = ["and-cuda"], optional = true} wandb = {version = "^0.17.5", optional = true} +koinapy = "^0.0.7" [tool.poetry.dev-dependencies] pytest = ">=6.2.3" diff --git a/requirements.txt b/requirements.txt index ea19791..0964b1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,25 +32,26 @@ flake8-docstrings==1.7.0 ; python_full_version >= "3.9.0" and python_full_versio flake8-rst-docstrings==0.3.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" flake8==7.1.1 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" fonttools==4.53.1 ; python_version >= "3.9" and python_full_version < "3.11.0" -grpcio==1.65.4 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +grpcio==1.65.4 ; python_full_version >= "3.9.0" and python_version < "3.11" h11==0.14.0 ; python_version >= "3.9" and python_full_version < "3.11.0" h5py==3.11.0 ; python_version >= "3.9" and python_full_version < "3.11.0" identify==2.6.0 ; python_version >= "3.9" and python_full_version < "3.11.0" idna==3.7 ; python_version >= "3.9" and python_full_version < "3.11.0" imagesize==1.4.1 ; python_version >= "3.9" and python_full_version < "3.11.0" importlib-metadata==8.2.0 ; python_version >= "3.9" and python_full_version < "3.11.0" -importlib-resources==6.4.0 ; python_version >= "3.9" and python_version < "3.10" +importlib-resources==6.4.2 ; python_version >= "3.9" and python_version < "3.10" iniconfig==2.0.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" jinja2==3.1.4 ; python_version >= "3.9" and python_full_version < "3.11.0" job-pool==0.2.6 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" joblib==1.4.2 ; python_version >= "3.9" and python_full_version < "3.11.0" kiwisolver==1.4.5 ; python_version >= "3.9" and python_full_version < "3.11.0" +koinapy==0.0.7 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" llvmlite==0.43.0 ; python_version >= "3.9" and python_full_version < "3.11.0" lxml==5.3.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" markdown-it-py==3.0.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" markupsafe==2.1.5 ; python_version >= "3.9" and python_full_version < "3.11.0" marshmallow==3.21.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" -matplotlib==3.9.1.post1 ; python_version >= "3.9" and python_full_version < "3.11.0" +matplotlib==3.9.2 ; python_version >= "3.9" and python_full_version < "3.11.0" mccabe==0.7.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" mdurl==0.1.2 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" moepy==1.1.4 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" @@ -62,7 +63,7 @@ nodeenv==1.9.1 ; python_version >= "3.9" and python_full_version < "3.11.0" numba==0.60.0 ; python_version >= "3.9" and python_full_version < "3.11.0" numpy==1.24.4 ; python_version >= "3.9" and python_version < "3.11" openpyxl==3.1.5 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" -packaging==24.1 ; python_version >= "3.9" and python_full_version < "3.11.0" +packaging==24.1 ; python_version >= "3.9" and python_version < "3.11" pandas==2.2.2 ; python_version >= "3.9" and python_full_version < "3.11.0" pathspec==0.12.1 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pbr==6.0.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" @@ -72,7 +73,7 @@ platformdirs==4.2.2 ; python_version >= "3.9" and python_full_version < "3.11.0" pluggy==1.5.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pre-commit-hooks==4.6.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pre-commit==3.8.0 ; python_version >= "3.9" and python_full_version < "3.11.0" -protobuf==4.25.4 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +protobuf==4.25.4 ; python_full_version >= "3.9.0" and python_version < "3.11" psutil==6.0.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pyarrow==17.0.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pycodestyle==2.12.1 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" @@ -87,7 +88,7 @@ pyparsing==3.1.2 ; python_version >= "3.9" and python_full_version < "3.11.0" pyteomics==4.7.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" pytest==8.3.2 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_full_version < "3.11.0" -python-rapidjson==1.20 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +python-rapidjson==1.20 ; python_full_version >= "3.9.0" and python_version < "3.11" pytz==2024.1 ; python_version >= "3.9" and python_full_version < "3.11.0" pyupgrade==3.17.0 ; python_version >= "3.9" and python_full_version < "3.11.0" pyyaml==6.0.2 ; python_version >= "3.9" and python_full_version < "3.11.0" @@ -103,13 +104,13 @@ safety==3.2.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0 scikit-learn==1.5.1 ; python_version >= "3.9" and python_full_version < "3.11.0" scipy==1.13.1 ; python_version >= "3.9" and python_full_version < "3.11.0" seaborn==0.13.2 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" -setuptools==72.1.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +setuptools==72.2.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" shellingham==1.5.4 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" six==1.16.0 ; python_version >= "3.9" and python_full_version < "3.11.0" sniffio==1.3.1 ; python_version >= "3.9" and python_full_version < "3.11.0" snowballstemmer==2.2.0 ; python_version >= "3.9" and python_full_version < "3.11.0" sortedcontainers==2.4.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" -spectrum-fundamentals @ git+ssh://git@github.com/wilhelm-lab/spectrum_fundamentals.git@9a8c0ae19485e3130c25148aeddd5f760c62b781 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +spectrum-fundamentals==0.7.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" spectrum-io==0.6.1 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" sphinx-autobuild==2024.4.16 ; python_version >= "3.9" and python_full_version < "3.11.0" sphinx-autodoc-typehints==2.2.3 ; python_version >= "3.9" and python_full_version < "3.11.0" @@ -130,15 +131,15 @@ tokenize-rt==6.0.0 ; python_version >= "3.9" and python_full_version < "3.11.0" tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" tqdm==4.66.5 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" triqler==0.7.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" -tritonclient[grpc]==2.47.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" +tritonclient[grpc]==2.47.0 ; python_full_version >= "3.9.0" and python_version < "3.11" typeguard==4.3.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" typer==0.12.3 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" types-attrs==19.1.0 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" types-requests==2.32.0.20240712 ; python_full_version >= "3.9.0" and python_full_version < "3.11.0" typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "3.11" tzdata==2024.1 ; python_version >= "3.9" and python_full_version < "3.11.0" -urllib3==2.2.2 ; python_version >= "3.9" and python_full_version < "3.11.0" -uvicorn==0.30.5 ; python_version >= "3.9" and python_full_version < "3.11.0" +urllib3==2.2.2 ; python_version >= "3.9" and python_version < "3.11" +uvicorn==0.30.6 ; python_version >= "3.9" and python_full_version < "3.11.0" virtualenv==20.26.3 ; python_version >= "3.9" and python_full_version < "3.11.0" watchfiles==0.23.0 ; python_version >= "3.9" and python_full_version < "3.11.0" websockets==12.0 ; python_version >= "3.9" and python_full_version < "3.11.0" From 746eeb49c94c097d52d70fef7eb3ab801ea610c8 Mon Sep 17 00:00:00 2001 From: Mario Picciani Date: Thu, 12 Sep 2024 17:21:12 +0200 Subject: [PATCH 2/4] fixed shape issue when transforming to dict --- oktoberfest/predict/koina.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oktoberfest/predict/koina.py b/oktoberfest/predict/koina.py index 9eb478a..b179d4d 100644 --- a/oktoberfest/predict/koina.py +++ b/oktoberfest/predict/koina.py @@ -58,7 +58,7 @@ def predict(self, data: dict[str, np.ndarray] | pd.DataFrame | Spectra, **kwargs data = data.obs if isinstance(data, pd.DataFrame): data = { - input_field: data[alternative_column_map[input_field]].to_numpy() + input_field: data[[alternative_column_map[input_field]]].to_numpy() for input_field in self.model_inputs.keys() } return super().predict(inputs=data, **kwargs) From e0b4a87dfbbf550cafce709fcbd9978b4a17ad30 Mon Sep 17 00:00:00 2001 From: Julius Schlensok Date: Fri, 13 Sep 2024 09:04:17 +0000 Subject: [PATCH 3/4] fix: remove obsolete kwarg for Koina --- oktoberfest/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oktoberfest/runner.py b/oktoberfest/runner.py index f171ce3..9bb4352 100644 --- a/oktoberfest/runner.py +++ b/oktoberfest/runner.py @@ -391,7 +391,7 @@ def generate_spectral_lib(config_path: Union[str, Path]): spec_library = _speclib_from_digestion(config) predictors = { - model_key: pr.Predictor.from_config(config, model_type=model_key, disable_progress_bar=True) + model_key: pr.Predictor.from_config(config, model_type=model_key) for model_key in config.models } From 20af248488e80d9b5e9cbe1dac01728848b555fe Mon Sep 17 00:00:00 2001 From: Julius Schlensok Date: Fri, 13 Sep 2024 09:09:01 +0000 Subject: [PATCH 4/4] fix(dlomix): clean up arbitrary kwarg passing to predictor interface implementations --- oktoberfest/predict/dlomix.py | 3 +-- oktoberfest/predict/predictor.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/oktoberfest/predict/dlomix.py b/oktoberfest/predict/dlomix.py index 75bbbfd..947f6b7 100644 --- a/oktoberfest/predict/dlomix.py +++ b/oktoberfest/predict/dlomix.py @@ -254,13 +254,12 @@ def __init__(self, model_type: str, model_path: Path, output_path: Path, batch_s _download_baseline_model(model_path) self.model = load_keras_model(str(model_path)) - def predict(self, data: Spectra, dataset_name: str, keep_dataset: bool = True, **kwargs) -> dict[str, np.ndarray]: + def predict(self, data: Spectra, dataset_name: str, keep_dataset: bool = True) -> dict[str, np.ndarray]: """Create predictions for dataset using Keras model. :param data: spectral library to predict features for :param dataset_name: Name of the dataset for storing processed files for DLomix :param keep_dataset: Whether to keep or discard the pre-processed dataset after inference - :param kwargs: In place to catch keyword arguments for other predictor implementations. :return: a dictionary containing predicted features (key: feature type) and a mask of the ion annotations of the predicted feature matrix (key: 'annotation') diff --git a/oktoberfest/predict/predictor.py b/oktoberfest/predict/predictor.py index 7c63363..de6394f 100644 --- a/oktoberfest/predict/predictor.py +++ b/oktoberfest/predict/predictor.py @@ -1,9 +1,10 @@ from __future__ import annotations import importlib +import inspect import logging from pathlib import Path -from typing import TYPE_CHECKING, Optional, Union +from typing import TYPE_CHECKING, Any, Optional, Union import numpy as np import pandas as pd @@ -101,6 +102,17 @@ def from_config(cls, config: Config, model_type: str, **kwargs) -> Predictor: model_type, model_path, output_folder, config.dlomix_inference_batch_size, download ) + def _filter_kwargs(self, **kwargs) -> dict[str, Any]: + """ + Get only arguments accepted by predictor implementation's predict() method from arbitrary set of kwargs. + + :param kwargs: Set of keyword arguments + + :return: Filtered set of keyword arguments + """ + signature = inspect.signature(self._predictor.predict) + return {key: value for key, value in kwargs.items() if key in signature.parameters} + def predict_intensities(self, data: Spectra, chunk_idx: Optional[list[pd.Index]] = None, **kwargs): """ Generate intensity predictions and add them to the provided data object. @@ -222,7 +234,7 @@ def predict_at_once(self, data: Spectra, **kwargs) -> dict[str, np.ndarray]: >>> predictions = intensity_predictor.predict_at_once(data=library) >>> print(predictions) """ - return self._predictor.predict(data, **kwargs) + return self._predictor.predict(data, **self._filter_kwargs(**kwargs)) def predict_in_chunks(self, data: Spectra, chunk_idx: list[pd.Index], **kwargs) -> dict[str, list[np.ndarray]]: """ @@ -267,7 +279,7 @@ def predict_in_chunks(self, data: Spectra, chunk_idx: list[pd.Index], **kwargs) """ results = [] for idx in chunk_idx: - results.append(self._predictor.predict(data[idx], **kwargs)) + results.append(self._predictor.predict(data[idx], **self._filter_kwargs(**kwargs))) ret_val = {key: [item[key] for item in results] for key in results[0].keys()} return ret_val