Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
17 changes: 9 additions & 8 deletions gemmapy/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
@author: omancarci
"""

import typing as T
import base64
import gzip

from typing import List, Union, Optional

def compress_arg(arg:str):
if arg is not None:
return base64.b64encode(gzip.compress(arg.encode())).decode()
else:
else:
return arg

def remove_nones(**kwargs):
Expand All @@ -23,19 +24,19 @@ def remove_nones(**kwargs):
out.pop(k)
return out

def add_to_filter(filt:T.Optional[str], prop: str, terms: T.List[T.Union[str,int]]):
def add_to_filter(filt: Optional[str], prop: str,
terms: Optional[List[Union[str, int]]]):
if terms is None:
return filt



if filt is None:
filt = ""

if len(filt)>0:
filt = filt + " and "

filt = filt + prop + " in (" + ",".join([str(x) for x in terms]) + ")"

return filt


Expand Down
Loading
Loading