SDRF -> sdrf_convert -> CLI||config
python -m sdrf_convert some.sdrf <tool> <additional_params_depending_on_tool>
Just enter
conda env create -f environment.yaml
conda activate sdrf_convert
and you are good to go.
Make sure to check if someone else altered environment.yaml
or pyproject.toml
after you pull the repository.
You might need to update
# conda environment
conda activate sdrf_convert
conda update -f environment.yaml
# python
pip install -e '.[dev]
environment.yaml
pyproject.toml
This ensures conda does not mess up our python environment AND all python packages are in one place once we want to publish.
_converter.py
from sdrf_convert import AbstractConverter
AbstractConverter
: class MyToolConverer(AbstractConverter):
def __init__(self):
super().__init__()
convert()
-function which calls init_converter()
Example:
# comet_converter.py
from sdrf_convert.abstract_converter import AbstractConverter
class CometConverter(AbstractConverter):
# Implement the stuff used to convert the
# SDRF for the specific software.
# E.g. constructor, conversions, lookups, ...
def __init__(self):
super().__init__()
def convert(self, sdrf: Union[pd.DataFrame, IOBase, Path]) -> Tuple[str, str]:
"""
Convert SDRF file to Comet CLI string and corresponding input file.
Returns
-------
Any
The converted SDRF file
"""
self.init_converter(sdrf)
# Do stuff
return (cli, config)
pylint sdrf_convert
) and fix your code styling