Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyOpenSci REVIEW - extract static classes and transfer to own modules #45

Merged
merged 30 commits into from
Jan 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7b21f36
extract static classes from parse.py
Robaina Jan 25, 2023
1d61985
extrac nested in LabelledFASTA
Robaina Jan 25, 2023
9b29294
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
ab8569f
update
Robaina Jan 25, 2023
27fdb9d
use only seqkit to remove duplicates
Robaina Jan 25, 2023
876edb3
minor updates
Robaina Jan 23, 2023
5ce9560
some updates
Robaina Jan 24, 2023
cfff82e
parser review
Robaina Jan 24, 2023
3859072
getter as property
Robaina Jan 24, 2023
12ee4ec
extrac nested in LabelledFASTA
Robaina Jan 25, 2023
5d85afd
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
48bf0ed
update
Robaina Jan 25, 2023
6b6798a
update
Robaina Jan 25, 2023
4e7504f
update logger init
Robaina Jan 25, 2023
9019d78
updat merge
Robaina Jan 25, 2023
3509fbd
extracted static classes from parser
Robaina Jan 25, 2023
bea7574
removed static classes
Robaina Jan 25, 2023
a118395
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
10abd0b
update
Robaina Jan 25, 2023
0d73f9c
parser review
Robaina Jan 24, 2023
e09d0c9
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
b368acb
update
Robaina Jan 25, 2023
82145b8
del parser.py
Robaina Jan 25, 2023
76c945d
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
a3702c0
update
Robaina Jan 25, 2023
c7abc32
parser review
Robaina Jan 24, 2023
e8ba1e0
extract nested functions in LabelledFasta
Robaina Jan 25, 2023
aaf7143
update
Robaina Jan 25, 2023
13dc179
merge
Robaina Jan 25, 2023
e3dda80
Merge branch 'main' into 44-pyopensci-review-static-classes
Robaina Jan 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor updates
  • Loading branch information
Robaina committed Jan 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 876edb37fba3da81ae6c83e76481cb9aff971dbc
2 changes: 1 addition & 1 deletion pynteny/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from pynteny.api import *
from pynteny.api import Command, Search, Build, Download
from pynteny.cli import main
7 changes: 4 additions & 3 deletions pynteny/api.py
Original file line number Diff line number Diff line change
@@ -24,10 +24,11 @@


class Command:
"""Parent class for Pynteny command"""
"""
Parent class for Pynteny command

def __init__(self):
"""Parent class for Pynteny command"""
args: CommandArgs
"""

def _repr_html_(self):
"""Executed by Jupyter to print Author and version in html"""
2 changes: 1 addition & 1 deletion pynteny/app/helpers.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
from pynteny.utils import ConfigParser


parent_dir = Path(Path(__file__).parent)
parent_dir = Path(__file__).parent


class FileManager:
2 changes: 1 addition & 1 deletion pynteny/app/main_page.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
from pynteny.app.components import Sidebar, Mainpage


parent_dir = Path(Path(__file__).parent)
parent_dir = Path(__file__).parent
meta = metadata.metadata("pynteny")
__version__ = meta["Version"]
__author__ = meta["Author"]
2 changes: 1 addition & 1 deletion pynteny/subcommands.py
Original file line number Diff line number Diff line change
@@ -272,7 +272,7 @@ def run_app() -> None:
config_path = config.get_config_path()
logfile = str(Path(config_path.parent) / "streamlit.log")
config.update_config("streamlit_log", logfile)
app_path = Path(Path(__file__).parent) / "app" / "main_page.py"
app_path = Path(__file__).parent / "app" / "main_page.py"
log_str = f"--logger.level=info 2> {logfile}"
cmd_str = (
f"streamlit run {app_path} --browser.gatherUsageStats False --server.fileWatcherType none "
2 changes: 1 addition & 1 deletion pynteny/utils.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ def initialize_config_file() -> Path:
Returns:
Path: path to generated config file.
"""
config_file = Path(Path(Path(__file__).parent).parent) / "config.json"
config_file = Path(__file__).parent.parent / "config.json"
if not config_file.exists():
config = {
"database_dir": "",
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pynteny"
version = "0.0.5"
version = "0.0.6"
description = "Synteny-aware hmm searches made easy in Python"
license = "Apache-2.0"
authors = ["Semidán Robaina Estévez <[email protected]>"]
@@ -25,6 +25,6 @@ include = [
"pynteny/app/assets/img/*"
]
[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
[tool.poetry.scripts]
pynteny = "pynteny.cli:main"
2 changes: 1 addition & 1 deletion tests/test_database_build.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
from pynteny.preprocessing import LabelledFASTA


this_file_dir = Path(Path(__file__).parent)
this_file_dir = Path(__file__).parent


class TestDatabase(unittest.TestCase):
2 changes: 1 addition & 1 deletion tests/test_hmm.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
import pandas as pd
from pynteny.hmm import PGAP, HMMER

this_file_dir = Path(Path(__file__).parent)
this_file_dir = Path(__file__).parent


class TestPGAP(unittest.TestCase):
2 changes: 1 addition & 1 deletion tests/test_integration_search.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

from pynteny.api import Search

this_file_dir = Path(Path(__file__).parent)
this_file_dir = Path(__file__).parent


class TestSyntenySearch(unittest.TestCase):
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from pynteny.filter import LabelParser, SyntenyParser


this_file_dir = Path(Path(__file__).parent)
this_file_dir = Path(__file__).parent


class TestLabelParser(unittest.TestCase):
2 changes: 1 addition & 1 deletion tests/test_preprocessing.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from pathlib import Path
from pynteny.preprocessing import RecordSequence, FASTA, LabelledFASTA

this_file_dir = Path(Path(__file__).parent)
this_file_dir = Path(__file__).parent


class TestRecordSequence(unittest.TestCase):