From 1da5c4609593f7e33b4fab433ec23d8ea96c2a37 Mon Sep 17 00:00:00 2001 From: Gonza10V Date: Mon, 28 Nov 2022 16:29:50 +0000 Subject: [PATCH 1/7] fixing build version to 3.7 as it does not work for 3.10 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 96cecc1..d3e67a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "pyflapjack" -version = "1.0.6" +version = "1.0.7" description = "Python package that interfaces the Flapjack API" readme = "README.md" -requires-python = ">=3.7" +requires-python = "3.7" license = {file = "LICENSE"} keywords = ["flapjack", "data", "experimental", "analysis", "synthetic biology"] authors = [ From 560f3fc08552351a437999c6bead9320ba254d66 Mon Sep 17 00:00:00 2001 From: Gonza10V Date: Mon, 28 Nov 2022 16:30:56 +0000 Subject: [PATCH 2/7] version 1.0.8 for Python 3.7 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d3e67a5..931bb26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyflapjack" -version = "1.0.7" +version = "1.0.8" description = "Python package that interfaces the Flapjack API" readme = "README.md" requires-python = "3.7" From f3c8b248387042bb807b6556eb8eb1b79a10630b Mon Sep 17 00:00:00 2001 From: Gonza10V Date: Tue, 30 May 2023 18:31:40 -0700 Subject: [PATCH 3/7] changes on create and np.int --- pyproject.toml | 6 +++--- src/flapjack/flapjack.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 931bb26..8139105 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "pyflapjack" -version = "1.0.8" +version = "1.0.10" description = "Python package that interfaces the Flapjack API" readme = "README.md" -requires-python = "3.7" +requires-python = ">=3.7,<3.10" license = {file = "LICENSE"} keywords = ["flapjack", "data", "experimental", "analysis", "synthetic biology"] authors = [ @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ - 'numpy==1.21.2', + 'numpy', 'scipy==1.8.0', 'pandas==1.3.3', 'requests==2.26.0', diff --git a/src/flapjack/flapjack.py b/src/flapjack/flapjack.py index 9846231..f3fd8d7 100644 --- a/src/flapjack/flapjack.py +++ b/src/flapjack/flapjack.py @@ -138,7 +138,7 @@ def create(self, model, confirm=True, overwrite=False, **kwargs): headers={'Authorization': 'Bearer ' + self.access_token}, data=kwargs ) - elif len(existing) and overwrite == False: + elif len(existing) and not overwrite: print(f'Returning exististing model, {model}') return existing @@ -190,7 +190,7 @@ def get(self, model, **kwargs): url = data['next'] df = pd.DataFrame(results) # Convert ids from np.int64 to int - df.index = df.index.astype(np.int) + df.index = df.index.astype(int) return df def parse_params(self, **kwargs): From cc1a9a414324d6c9b2d883e79d2cb7d9a12f77f7 Mon Sep 17 00:00:00 2001 From: Gonza10V Date: Wed, 18 Jun 2025 11:02:47 -0600 Subject: [PATCH 4/7] version working for 3.10 --- pyproject.toml | 12 ++++----- src/flapjack/flapjack.py | 53 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8139105..d861278 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "pyflapjack" -version = "1.0.10" +version = "1.0.13" description = "Python package that interfaces the Flapjack API" readme = "README.md" -requires-python = ">=3.7,<3.10" +requires-python = ">=3.7,<=3.10" license = {file = "LICENSE"} keywords = ["flapjack", "data", "experimental", "analysis", "synthetic biology"] authors = [ @@ -24,10 +24,10 @@ classifiers = [ ] dependencies = [ - 'numpy', - 'scipy==1.8.0', + 'numpy== 1.26.1', + 'scipy==1.11.0', 'pandas==1.3.3', - 'requests==2.26.0', + 'requests>=2.25.1', 'tqdm==4.62.3', 'plotly==5.3.1', 'asyncio==3.4.3', @@ -35,7 +35,7 @@ dependencies = [ 'requests_jwt==0.5.3', 'websockets==10.0', 'matplotlib==3.4.3', - 'kaleido' + 'kaleido==0.2.1' ] [project.optional-dependencies] diff --git a/src/flapjack/flapjack.py b/src/flapjack/flapjack.py index f3fd8d7..7f2d428 100644 --- a/src/flapjack/flapjack.py +++ b/src/flapjack/flapjack.py @@ -58,7 +58,55 @@ def __del__(self): def handle_response(self, s): return True - + # Sign in to the server + + def sign_up(self, username, password, email): + try: + s = requests.post( + self.http_url_base+'/api/auth/sign_up/', + data={ + 'username':username, + 'password':password, + 'email':email + } + ) + except: + print(f'Sign up failed.') + else: + if self.handle_response(s): + print(f'Successfully signed up as {username}.') + self.log_in(username, password) + + def register(self, username, password, password2, email): + try: + s = requests.post( + self.http_url_base+'/api/auth/register/', + data={ + 'username':username, + 'password':password, + 'password2':password2, + 'email':email + } + ) + except: + print(f'Register failed.') + else: + if self.handle_response(s): + self.username = username + data = s.json() + self.access_token = data['access'] + self.refresh_token = data['refresh'] + + def log_in_token(self, username, access_token, refresh_token): + try: + self.username = username + self.access_token = access_token + self.refresh_token = refresh_token + except: + print(f'Invalid token') + + + def log_in(self, username, password): try: s = requests.post( @@ -76,7 +124,6 @@ def log_in(self, username, password): data = s.json() self.access_token = data['access'] self.refresh_token = data['refresh'] - self.username = username def log_out(self): if self.username: @@ -84,7 +131,7 @@ def log_out(self): s = requests.post( self.http_url_base+'/api/auth/log_out/', data={ - 'username':username + 'username':self.username } ) except: From 334584022a809ae0909bf1567e0c89f7a88f9814 Mon Sep 17 00:00:00 2001 From: Gonza10V Date: Wed, 18 Jun 2025 11:13:17 -0600 Subject: [PATCH 5/7] change in supported Python version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d861278..1632ad7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "pyflapjack" -version = "1.0.13" +version = "1.0.14" description = "Python package that interfaces the Flapjack API" readme = "README.md" -requires-python = ">=3.7,<=3.10" +requires-python = ">=3.7,<3.11" license = {file = "LICENSE"} keywords = ["flapjack", "data", "experimental", "analysis", "synthetic biology"] authors = [ From 7221a6b37dff31fc809d4b7dbb1c24eea2c0472d Mon Sep 17 00:00:00 2001 From: Gonzalo Vidal <35148159+Gonza10V@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:15:44 -0600 Subject: [PATCH 6/7] Update matplotlib version constraint in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1632ad7..b183fb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ 'nest_asyncio==1.5.1', 'requests_jwt==0.5.3', 'websockets==10.0', - 'matplotlib==3.4.3', + 'matplotlib>=3.10', 'kaleido==0.2.1' ] From f5b0467d7d629589e1f6afdc5dd82345be651aed Mon Sep 17 00:00:00 2001 From: Gonzalo Vidal <35148159+Gonza10V@users.noreply.github.com> Date: Wed, 13 May 2026 15:40:48 -0600 Subject: [PATCH 7/7] Update numpy and pandas dependencies --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b183fb9..a1e9e6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ ] dependencies = [ - 'numpy== 1.26.1', + 'numpy== 1.26.2', 'scipy==1.11.0', - 'pandas==1.3.3', + 'pandas==1.5.3', 'requests>=2.25.1', 'tqdm==4.62.3', 'plotly==5.3.1',