Skip to content

Commit

Permalink
Merge pull request #187 from pepkit/dev_pephub_backend
Browse files Browse the repository at this point in the history
Add pephub backend to Pipestat
  • Loading branch information
donaldcampbelljr authored Jul 18, 2024
2 parents 285d9db + d07fbb1 commit 9230e21
Show file tree
Hide file tree
Showing 26 changed files with 892 additions and 194 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ include pipestat/schemas/*
include pipestat/backends/*
include pipestat/backends/file_backend/*
include pipestat/backends/db_backend/*
include pipestat/backends/pephub_backend/*
include pipestat/pipestatreader/*
include pipestat/jinja_templates/*
10 changes: 2 additions & 8 deletions pipestat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
import logmuse

from ._version import __version__
from .exceptions import PipestatError
from .const import PKG_NAME
from .pipestat import (
PipestatManager,
SamplePipestatManager,
ProjectPipestatManager,
PipestatBoss,
)

from .exceptions import PipestatError
from .pipestat import PipestatBoss, PipestatManager, ProjectPipestatManager, SamplePipestatManager

__all__ = [
"PipestatError",
Expand Down
3 changes: 2 additions & 1 deletion pipestat/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import argparse
import os

from ubiquerg import VersionInHelpParser
from ._version import __version__

from ._version import __version__
from .const import ENV_VARS, PKG_NAME, STATUS_SCHEMA

REPORT_CMD = "report"
Expand Down
6 changes: 3 additions & 3 deletions pipestat/backends/abstract.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
from abc import ABC
from logging import getLogger
from typing import Any, Dict, List, Optional, Tuple, Union

from ubiquerg import expandpath
from typing import List, Dict, Any, Optional, Union, Tuple

from ..const import PKG_NAME, STATUS
from ..helpers import force_symlink
from ..exceptions import SchemaError

from ..helpers import force_symlink

_LOGGER = getLogger(PKG_NAME)

Expand Down
4 changes: 1 addition & 3 deletions pipestat/backends/db_backend/db_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
from typing import Any, Dict, List, Optional, Union
from urllib.parse import quote_plus


from sqlmodel import and_, or_, Integer, Float, String, Boolean

from sqlmodel import Boolean, Float, Integer, String, and_, or_

from pipestat.exceptions import MissingConfigDataError

Expand Down
7 changes: 3 additions & 4 deletions pipestat/backends/db_backend/db_parsed_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from typing import Any, Dict, List, Mapping, Optional

from pydantic import ConfigDict, create_model


from sqlalchemy import Column, null
from sqlalchemy.dialects.postgresql import JSONB
from sqlmodel import Field, SQLModel

from pipestat.const import (
CANONICAL_TYPES,
CLASSES_BY_TYPE,
Expand All @@ -22,13 +21,13 @@
PROJECT_NAME,
RECORD_IDENTIFIER,
SAMPLE_NAME,
STATUS,
SCHEMA_DESC_KEY,
SCHEMA_ITEMS_KEY,
SCHEMA_PROP_KEY,
SCHEMA_TYPE_KEY,
STATUS,
)
from pipestat.exceptions import SchemaError, PipestatError
from pipestat.exceptions import PipestatError, SchemaError
from pipestat.parsed_schema import ParsedSchema

_LOGGER = logging.getLogger(__name__)
Expand Down
17 changes: 9 additions & 8 deletions pipestat/backends/db_backend/dbbackend.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import copy
import datetime
from logging import getLogger
from contextlib import contextmanager
from typing import List, Dict, Any, Optional, Union, NoReturn, Tuple
from logging import getLogger
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Union

from sqlmodel import SQLModel, Session, create_engine, select as sql_select
from sqlmodel import Session, SQLModel, create_engine
from sqlmodel import select as sql_select

from pipestat.backends.db_backend.db_helpers import selection_filter
from pipestat.backends.abstract import PipestatBackend
from pipestat.backends.db_backend.db_helpers import selection_filter

from ...const import CREATED_TIME, MODIFIED_TIME, PKG_NAME, RECORD_IDENTIFIER, STATUS
from ...exceptions import (
ColumnNotFoundError,
PipestatDatabaseError,
RecordNotFoundError,
SchemaError,
ColumnNotFoundError,
UnrecognizedStatusError,
SchemaNotFoundError,
UnrecognizedStatusError,
)
from ...const import PKG_NAME, STATUS, RECORD_IDENTIFIER, CREATED_TIME, MODIFIED_TIME


_LOGGER = getLogger(PKG_NAME)

Expand Down
22 changes: 9 additions & 13 deletions pipestat/backends/file_backend/filebackend.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import datetime
import os.path
import operator
import os.path
from copy import deepcopy
from functools import reduce
from itertools import chain
from ...helpers import get_all_result_files


from glob import glob
from itertools import chain
from logging import getLogger
from yacman import FutureYAMLConfigManager as YAMLConfigManager
from yacman import read_lock, write_lock
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union

from ubiquerg import create_lock, remove_lock
from yacman import FutureYAMLConfigManager as YAMLConfigManager
from yacman import read_lock, write_lock

from typing import List, Dict, Any, Optional, Union, Literal, Callable, Tuple

from ...exceptions import UnrecognizedStatusError, PipestatError
from ...backends.abstract import PipestatBackend
from ...const import DATE_FORMAT, PKG_NAME, CREATED_TIME, MODIFIED_TIME, META_KEY, HISTORY_KEY

from ...const import CREATED_TIME, DATE_FORMAT, HISTORY_KEY, META_KEY, MODIFIED_TIME, PKG_NAME
from ...exceptions import PipestatError, UnrecognizedStatusError
from ...helpers import get_all_result_files

_LOGGER = getLogger(PKG_NAME)

Expand All @@ -46,7 +42,7 @@ def __init__(
this object method calls
:param str pipeline_name: name of pipeline associated with result
:param str pipeline_type: "sample" or "project"
:param str parsed_schema: results output schema. Used to construct DB columns.
:param str parsed_schema: results output schema.
:param str status_schema: schema containing pipeline statuses e.g. 'running'
:param str status_file_dir: directory for placing status flags
:param str result_formatter: function for formatting result
Expand Down
Empty file.
Loading

0 comments on commit 9230e21

Please sign in to comment.