Skip to content

Commit

Permalink
remove logmuse. See #29
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Oct 26, 2023
1 parent da1c1a9 commit b6c8a11
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
3 changes: 0 additions & 3 deletions bbconf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import logmuse

from bbconf._version import __version__
from bbconf.bbconf import *
from bbconf.const import *

__all__ = ["BedBaseConf", "get_bedbase_cfg"]

logmuse.init_logger("bbconf")
28 changes: 17 additions & 11 deletions bbconf/bbconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
_LOGGER = getLogger(PKG_NAME)

DRS_ACCESS_URL = "{server_url}/objects/{object_id}/access/{access_id}"


class BedBaseConf:
"""
This class standardizes reporting of bedstat and bedbuncher results.
Expand Down Expand Up @@ -602,25 +604,29 @@ def get_bed_drs_metadata(object_id: str) -> dict:
"size": bed_metadata["file_size"],
"created_time": bed_metadata["created_time"],
"checksums": object_id,
"access_methods": []
"access_methods": [],
}
# add access method for each remote class
for access_id in keys(self.config[CFG_REMOTE_KEY]):
access_dict = {
"type": "https",
"access_id": access_id,
"access_url": DRS_ACCESS_URL.format(
server_url=self.config["access_methods"][access_id]["server_url"],
object_id=object_id,
access_id=access_id)
}
access_dict["region"] = self.config["access_methods"][access_id]["region"] or None
"type": "https",
"access_id": access_id,
"access_url": DRS_ACCESS_URL.format(
server_url=self.config["access_methods"][access_id]["server_url"],
object_id=object_id,
access_id=access_id,
),
}
access_dict["region"] = (
self.config["access_methods"][access_id]["region"] or None
)
drs_dict["access_methods"].append(access_dict)
return drs_dict

def get_bed_url(object_id: str, access_id: str) -> str:
access_url = DRS_ACCESS_URL.format(
server_url=self.config["access_methods"][access_id]["server_url"],
object_id=object_id,
access_id=access_id)
access_id=access_id,
)
return access_url
19 changes: 19 additions & 0 deletions interactive_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from bbconf import BedBaseConf

import logging
import sys

log = logging.getLogger()
log.setLevel(logging.DEBUG)
stream = logging.StreamHandler(sys.stdout)
stream.setLevel(logging.DEBUG)
log.addHandler(stream)
logging.getLogger("bbconf").setLevel(logging.DEBUG)

bbc = BedBaseConf("bedbase.org/config/bedbase2.yaml")

bbc.bed.retrieve("78c0e4753d04b238fc07e4ebe5a02984")

bbc.bed.retrieve("78c0e4753d04b238fc07e4ebe5a02984", "bedfile")

bbc.bed.retrieve("78c0e4753d04b238fc07e4ebe5a02984", result_identifier="bedfile")
1 change: 0 additions & 1 deletion requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
logmuse
yacman>=0.9.1
pipestat>=0.6.0a2
#pipestat @ git+https://github.com/pepkit/pipestat@dev#egg=pipestat
Expand Down

0 comments on commit b6c8a11

Please sign in to comment.