Skip to content

Commit

Permalink
chore: prod deployment, may 3rd
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzi authored May 3, 2024
2 parents 6454b07 + 5872bdd commit b88cf23
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
28 changes: 15 additions & 13 deletions backend/wmg/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import time
from typing import Optional

# import tiledb
import tiledb

from backend.common.utils.result_notification import (
format_failed_batch_issue_slack_alert,
gen_wmg_pipeline_failure_message,
gen_wmg_pipeline_success_message,
notify_slack,
)
from backend.wmg.data.snapshot import CELL_COUNTS_CUBE_NAME
from backend.wmg.pipeline.cell_type_ancestors import create_cell_type_ancestors
from backend.wmg.pipeline.cell_type_ordering import create_cell_type_ordering
from backend.wmg.pipeline.constants import (
Expand All @@ -27,6 +29,7 @@
WMG_DATA_SCHEMA_VERSION,
)
from backend.wmg.pipeline.dataset_metadata import create_dataset_metadata
from backend.wmg.pipeline.errors import PipelineStepMissing
from backend.wmg.pipeline.expression_summary_and_cell_counts import create_expression_summary_and_cell_counts_cubes
from backend.wmg.pipeline.expression_summary_default import create_expression_summary_default_cube
from backend.wmg.pipeline.expression_summary_diffexp import create_expression_summary_diffexp_cubes
Expand Down Expand Up @@ -85,8 +88,7 @@ def run_pipeline(corpus_path: Optional[str] = None, skip_validation: bool = Fals
snapshot_id=snapshot_id,
is_snapshot_validation_successful=is_valid,
)
# stats = _get_stats(corpus_path)
stats = {"dataset_count": 0, "cell_count": 0}
stats = _get_stats(corpus_path)

if is_valid:
logger.info(f"Updated latest_snapshot_identifier in s3. Current snapshot location: {cube_data_s3_path}")
Expand Down Expand Up @@ -126,15 +128,15 @@ def main():
sys.exit()


# def _get_stats(corpus_path: str) -> dict[str, int]:
# pipeline_state = load_pipeline_state(corpus_path)
# if not pipeline_state.get(EXPRESSION_SUMMARY_AND_CELL_COUNTS_CUBE_CREATED_FLAG):
# raise PipelineStepMissing("cell_counts")
def _get_stats(corpus_path: str) -> dict[str, int]:
pipeline_state = load_pipeline_state(corpus_path)
if not pipeline_state.get(EXPRESSION_SUMMARY_AND_CELL_COUNTS_CUBE_CREATED_FLAG):
raise PipelineStepMissing("cell_counts")

# # get dataset count
# with tiledb.open(os.path.join(corpus_path, CELL_COUNTS_CUBE_NAME)) as cc_cube:
# cell_counts_df = cc_cube.df[:]
# dataset_count = len(cell_counts_df["dataset_id"].unique())
# cell_count = int(cell_counts_df["n_cells"].sum())
# get dataset count
with tiledb.open(os.path.join(corpus_path, CELL_COUNTS_CUBE_NAME)) as cc_cube:
cell_counts_df = cc_cube.df[:]
dataset_count = len(cell_counts_df["dataset_id"].unique())
cell_count = int(cell_counts_df["n_cells"].sum())

# return {"dataset_count": dataset_count, "cell_count": cell_count}
return {"dataset_count": dataset_count, "cell_count": cell_count}
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ function getCenteringNode(
cellTypeId?: string
) {
// We find the target node that has children visible.
// By construction, only one copy of the target node in the tree will have children visible.
// By construction, only one copy of the target node in the tree will be expanded at first.
// The target node is the node corresponding to the cell type id of the CellGuideCard.
// If lastNodeClicked is not null, the target node is the last node that was clicked.

Expand All @@ -927,8 +927,10 @@ function getCenteringNode(
(node) =>
(lastNodeClicked
? node.data.id === lastNodeClicked
: node.data.id.split("__").at(0) === cellTypeId) && node.data.children
: node.data.id.split("__").at(0) === cellTypeId) &&
node.data.isExpanded
) as HierarchyPointNode<TreeNodeWithState> | undefined;

// If no target nodes have children, just pick any target node.
if (!targetNode) {
targetNode = data
Expand Down
4 changes: 2 additions & 2 deletions python_dependencies/cellguide_pipeline/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ charset-normalizer==3.2.0
ddtrace==2.1.4
fastobo==0.12.2
h5py==3.9.0
idna==3.4
idna==3.7
jmespath==1.0.1
llvmlite==0.42.0
natsort==8.4.0
Expand All @@ -30,7 +30,7 @@ s3transfer==0.6.1
scipy==1.11.1
six==1.16.0
tiledb
typing_extensions==4.7.1
typing_extensions==4.11.0
tzdata==2023.3
urllib3==1.26.16
pyarrow==12.0.0
Expand Down

0 comments on commit b88cf23

Please sign in to comment.