Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.11.5 #279

Merged
merged 32 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b98fc0d
fix no projects found showing up (#276)
nleroy917 Jan 24, 2024
fd4b861
(#275)
nleroy917 Jan 24, 2024
3c6794b
fix offset bug when searching namespace (#272)
nleroy917 Jan 24, 2024
e70a00b
update and fix add to pop form (#270)
nleroy917 Jan 24, 2024
07ce2ea
more updates (#270)
nleroy917 Jan 24, 2024
a69e28b
Merge pull request #278 from pepkit/bug-fixing
nleroy917 Jan 24, 2024
6cfbc5d
remove unnecessary import
nleroy917 Feb 1, 2024
7a02da6
apply fix for bad schema paths (#285)
nleroy917 Feb 1, 2024
759a3a5
work on sample table height
nleroy917 Feb 1, 2024
279e20f
updated project page size
khoroshevskyi Feb 1, 2024
eeb7817
fixed nan value in the table
khoroshevskyi Feb 1, 2024
7f91246
fixed updating
khoroshevskyi Feb 1, 2024
b47cd87
fixed subsample endpoint
khoroshevskyi Feb 2, 2024
7703f95
download all geo button
nleroy917 Feb 2, 2024
1c2b869
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
nleroy917 Feb 2, 2024
849fa92
updated pepdbagent version + docs
khoroshevskyi Feb 2, 2024
efbc283
Merge remote-tracking branch 'origin/dev' into dev
khoroshevskyi Feb 2, 2024
05fe5b3
description more toggle
nleroy917 Feb 2, 2024
a43949a
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
nleroy917 Feb 2, 2024
1d7c4cb
added views and samples exceptions
khoroshevskyi Feb 2, 2024
509ac84
finihs mobile nav
nleroy917 Feb 4, 2024
8923fbe
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
nleroy917 Feb 4, 2024
043c4fc
add confirm dialogue to the PEP removal modal (#277)
nleroy917 Feb 5, 2024
e785137
fixed subsamples
khoroshevskyi Feb 5, 2024
e0de035
Merge remote-tracking branch 'origin/dev' into dev
khoroshevskyi Feb 5, 2024
2b3c3ae
bump pepdbagent to resolve #290
nleroy917 Feb 5, 2024
f4129a7
remove add button from non-user or org pops
nleroy917 Feb 5, 2024
b136e90
allow users to see pops from other orgs (#291)
nleroy917 Feb 5, 2024
b9b8335
samples are read only when sample table is large (#289)
nleroy917 Feb 5, 2024
fe28b04
version + changelog
nleroy917 Feb 5, 2024
db04023
updated error raising
khoroshevskyi Feb 5, 2024
3112e73
delete unused code
khoroshevskyi Feb 5, 2024
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
11 changes: 10 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.11.5] - 02-02-2024

### Fixed

- POP updated
- Bug in updating project config file
- Subsample endpoint
- Lots more UI bugs that include some security vulnerabilities and stability issues

## [0.11.4] - 01-22-2024

### Fixed
- Downloading zip files

- Downloading zip files

## [0.11.2] - 01-17-2024

Expand Down
2 changes: 1 addition & 1 deletion pephub/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.4"
__version__ = "0.11.5"
110 changes: 79 additions & 31 deletions pephub/routers/api/v1/project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import eido
import yaml
import pandas as pd
import numpy as np
import peppy
import logging
from typing import Callable, Literal, Union, Optional, List, Annotated
Expand All @@ -22,6 +23,10 @@
ProjectUniqueNameError,
SampleAlreadyInView,
SampleNotFoundError,
ViewNotFoundError,
ProjectNotFoundError,
ViewAlreadyExistsError,
SampleAlreadyExistsError,
)
from pepdbagent.models import (
AnnotationModel,
Expand Down Expand Up @@ -303,10 +308,10 @@ async def update_a_pep(
# status_code=400,
# detail=f"Invalid update key: {k}",
# )
# add params to new_raw_project if update_dict is not empty
if len(update_dict) > 0:
for k, v in update_dict.items():
new_raw_project["_config"][k] = v
# # add params to new_raw_project if update_dict is not empty
# if len(update_dict) > 0:
# for k, v in update_dict.items():
# new_raw_project["_config"][k] = v
khoroshevskyi marked this conversation as resolved.
Show resolved Hide resolved
agent.project.update(
dict(project=Project().from_dict(new_raw_project), **update_dict),
namespace,
Expand Down Expand Up @@ -397,7 +402,7 @@ async def get_pep_samples(
return JSONResponse(
{
"count": df.shape[0],
"items": df.replace({pd.NA: None}).to_dict(orient="records"),
"items": df.replace({np.nan: None}).to_dict(orient="records"),
}
)
else:
Expand Down Expand Up @@ -503,8 +508,8 @@ async def update_sample(
"""
if namespace not in list_of_admins:
raise HTTPException(
detail="You do not have permission to update this project.",
status_code=401,
detail="Sample does not exist, or you do not have permission to update this sample.",
status_code=404,
)
try:
agent.sample.update(
Expand All @@ -521,10 +526,10 @@ async def update_sample(
},
status_code=202,
)
except Exception as e:
except SampleNotFoundError:
raise HTTPException(
status_code=400,
detail=f"Could not update sample. Server error: {e}",
status_code=404,
detail="Sample does not exist, or you do not have permission to update this sample.",
)


Expand Down Expand Up @@ -564,10 +569,17 @@ async def upload_sample(
},
status_code=202,
)
except Exception:

except SampleAlreadyExistsError:
raise HTTPException(
status_code=409,
detail="Sample already exists in project. Use 'overwrite' parameter to overwrite.",
)

except Exception as e:
raise HTTPException(
status_code=400,
detail="Could not upload sample. Server error!",
detail=f"Could not upload sample. Server error: {e}",
khoroshevskyi marked this conversation as resolved.
Show resolved Hide resolved
)


Expand Down Expand Up @@ -600,6 +612,11 @@ async def delete_sample(
},
status_code=202,
)
except SampleNotFoundError:
raise HTTPException(
status_code=404,
detail="Sample not found in project.",
)
except Exception:
raise HTTPException(
status_code=400,
Expand All @@ -622,8 +639,13 @@ async def get_subsamples(
project: example
namespace: databio
"""
subsamples = proj[SUBSAMPLE_RAW_LIST_KEY]
if subsamples is not None:
if isinstance(proj, dict):
subsamples = proj[SUBSAMPLE_RAW_LIST_KEY]
else:
subsamples = proj.to_dict(extended=True, orient="records")[
SUBSAMPLE_RAW_LIST_KEY
]
if subsamples:
try:
subsamples = pd.DataFrame(
proj[SUBSAMPLE_RAW_LIST_KEY][0]
Expand Down Expand Up @@ -804,24 +826,30 @@ async def get_view_of_the_project(
"""
Fetch a view of the project.
"""
if raw:
return ProjectRawModel(
**agent.view.get(
try:
if raw:
return ProjectRawModel(
**agent.view.get(
namespace=namespace,
name=project,
view_name=view,
tag=tag,
raw=raw,
)
)
else:
return agent.view.get(
namespace=namespace,
name=project,
view_name=view,
tag=tag,
raw=raw,
)
).to_dict()
except ViewNotFoundError:
raise HTTPException(
status_code=404,
detail=f"View '{view}' not found in project '{namespace}/{project}:{tag}'",
)
else:
return agent.view.get(
namespace=namespace,
name=project,
view_name=view,
tag=tag,
raw=raw,
).to_dict()


@project.post(
Expand Down Expand Up @@ -858,10 +886,20 @@ async def create_view_of_the_project(
sample_list=sample_names,
),
)
except Exception as e:
except SampleNotFoundError as e:
raise HTTPException(
status_code=404,
detail=f"Sample '{e}' not found in project '{namespace}/{project}:{tag}'",
)
except ProjectNotFoundError:
raise HTTPException(
status_code=404,
detail=f"Project '{namespace}/{project}:{tag}' not found",
)
except ViewAlreadyExistsError as e:
_LOGGER.error(f"Could not create view. Error: {e}")
raise HTTPException(
status_code=400,
status_code=409,
detail="Could not create view. Server error",
)
return JSONResponse(
Expand Down Expand Up @@ -928,12 +966,12 @@ async def add_sample_to_view(
)
except SampleAlreadyInView:
raise HTTPException(
status_code=400,
status_code=409,
detail=f"Sample '{sample_name}' already in view '{view}'",
)
except SampleNotFoundError:
raise HTTPException(
status_code=400,
status_code=404,
detail=f"Sample '{sample_name}' not found in project '{namespace}/{project}:{tag}'",
)
return JSONResponse(
Expand Down Expand Up @@ -974,9 +1012,14 @@ def delete_sample_from_view(
)
except SampleNotFoundError:
raise HTTPException(
status_code=400,
status_code=404,
detail=f"Sample '{sample_name}' not found in view '{view}'",
)
except ViewNotFoundError:
raise HTTPException(
status_code=404,
detail=f"View '{view}' not found in project '{namespace}/{project}:{tag}'",
)
return JSONResponse(
content={
"message": "Sample deleted from view successfully.",
Expand Down Expand Up @@ -1011,6 +1054,11 @@ def delete_view(
project_tag=tag,
view_name=view,
)
except ViewNotFoundError:
raise HTTPException(
status_code=404,
detail=f"View '{view}' not found in project '{namespace}/{project}:{tag}'",
)
except Exception:
raise HTTPException(
status_code=400,
Expand Down
1 change: 0 additions & 1 deletion pephub/routers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ProjectOptional(UpdateItems):
project_config_yaml: Optional[str] = None
description: Optional[str] = None
subsample_tables: Optional[List[List[dict]]] = None
pop: Optional[bool] = None

model_config = ConfigDict(populate_by_name=True)

Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fastapi>=0.108.0
psycopg>=3.1.15
pepdbagent>=0.7.1
pepdbagent @ git+https://github.com/pepkit/pepdbagent.git@dev#egg=pepdbagent
peppy>=0.40.1
eido>=0.2.2
jinja2>=3.1.2
Expand Down
2 changes: 1 addition & 1 deletion web/src/api/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const submitPop = (
});
};

export const starRepository = (
export const starProject = (
namespace: string,
star_namespace: string,
star_project: string,
Expand Down
Loading
Loading