Skip to content

Commit

Permalink
added better messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Sep 23, 2024
1 parent 1ddc533 commit 76edbbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bedboss/bbuploader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from bbconf import BedBaseAgent
from bbconf.db_utils import GeoGseStatus, GeoGsmStatus
from pephubclient import PEPHubClient
from pephubclient.helpers import MessageHandler
from pephubclient.models import SearchReturnModel
from sqlalchemy import and_, select
from sqlalchemy.orm import Session
Expand Down Expand Up @@ -78,9 +79,14 @@ def upload_all(
_LOGGER.info(f"found {pep_annotation_list.count} projects")

count = 0
total_projects = len(pep_annotation_list.results)
for gse_pep in pep_annotation_list.results:
count += 1
with Session(bbagent.config.db_engine.engine) as session:
_LOGGER.info(f"Processing: '{gse_pep.name}'")
MessageHandler.print_success(f"{'##' * 30}")
MessageHandler.print_success(
f"#### Processing: '{gse_pep.name}'. #### Processing {count} / {total_projects}. ####"
)

gse_status = session.scalar(
select(GeoGseStatus).where(GeoGseStatus.gse == gse_pep.name)
Expand Down Expand Up @@ -124,6 +130,7 @@ def upload_all(
sa_session=session,
gse_status_sa_model=gse_status,
standardize_pep=standardize_pep,
rerun=rerun,
)
except Exception as err:
_LOGGER.error(
Expand All @@ -136,7 +143,6 @@ def upload_all(
status_parser(gse_status, upload_result)
session.commit()

count += 1
if count >= download_limit:
break

Expand Down
2 changes: 1 addition & 1 deletion test/test_ref_validator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from bedboss.refgenome_validator import ReferenceValidator
from bedboss.refgenome_validator.main import ReferenceValidator


FILE_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down

0 comments on commit 76edbbb

Please sign in to comment.