Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nleroy917 committed Feb 2, 2024
2 parents 7703f95 + b47cd87 commit 1c2b869
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
15 changes: 8 additions & 7 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 Down Expand Up @@ -303,10 +304,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
agent.project.update(
dict(project=Project().from_dict(new_raw_project), **update_dict),
namespace,
Expand Down Expand Up @@ -397,7 +398,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 @@ -622,8 +623,8 @@ async def get_subsamples(
project: example
namespace: databio
"""
subsamples = proj[SUBSAMPLE_RAW_LIST_KEY]
if subsamples is not None:
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
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
4 changes: 2 additions & 2 deletions web/src/pages/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export const ProjectPage: FC = () => {
{projectView === 'samples' ? (
<SampleTable
// fill to the rest of the screen minus the offset of the project data
height={window.innerHeight - (projectDataRef.current?.offsetTop || 300)}
height={window.innerHeight - 15 - (projectDataRef.current?.offsetTop || 300)}
readOnly={!(projectInfo && canEdit(user, projectInfo))}
data={newProjectSamples || []}
onChange={(value) => setNewProjectSamples(value)}
Expand All @@ -524,7 +524,7 @@ export const ProjectPage: FC = () => {
<>
<SampleTable
// fill to the rest of the screen minus the offset of the project data
height={window.innerHeight - (projectDataRef.current?.offsetTop || 300)}
height={window.innerHeight - 15 - (projectDataRef.current?.offsetTop || 300)}
readOnly={!(projectInfo && canEdit(user, projectInfo))}
data={newProjectSubsamples || []}
onChange={(value) => setNewProjectSubsamples(value)}
Expand Down

0 comments on commit 1c2b869

Please sign in to comment.