Skip to content

Commit

Permalink
Avoid imports in main __init__.py
Browse files Browse the repository at this point in the history
Avoid circular import issues
  • Loading branch information
dweindl committed Feb 20, 2025
1 parent 3d28847 commit 99251d2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
17 changes: 0 additions & 17 deletions src/ccompass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,3 @@
* CPA: compartment protein amount (= CC * TPA)
* nCPA: normalized CPA (= nCC * TPA)
"""

from pathlib import Path

from ._utils import get_ccmps_data_directory

__all__ = []

# the application settings file
config_filepath: Path = get_ccmps_data_directory() / "settings.yaml"

# the repository URL
repository_url = "https://github.com/ICB-DCM/C-COMPASS/"
# the ReadTheDocs URL
readthedocs_url = "https://c-compass.readthedocs.io/en/latest/"

# name of the application
app_name = "C-COMPASS"
2 changes: 1 addition & 1 deletion src/ccompass/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.console import Console
from rich.logging import RichHandler

from . import app_name
from ccompass.core import app_name


def main():
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/about_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import FreeSimpleGUI as sg

from . import app_name, repository_url
from .core import app_name, repository_url


def get_license_id(dist: Distribution) -> str:
Expand Down
12 changes: 11 additions & 1 deletion src/ccompass/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@
field_validator,
)

from . import config_filepath
from ._utils import get_ccmps_data_directory

logger = logging.getLogger(__name__)


#: the application settings file
config_filepath: Path = get_ccmps_data_directory() / "settings.yaml"
#: the repository URL
repository_url = "https://github.com/ICB-DCM/C-COMPASS/"
#: the ReadTheDocs URL
readthedocs_url = "https://c-compass.readthedocs.io/en/latest/"
#: name of the application
app_name = "C-COMPASS"


#: The value used in the sample tables as condition IDs to indicate the column
# that contains the protein IDs.
IDENTIFIER = "[IDENTIFIER]"
Expand Down
5 changes: 4 additions & 1 deletion src/ccompass/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
import pandas as pd

from . import MOA, RP, app_name, readthedocs_url, repository_url
from . import MOA, RP
from ._gui_utils import wait_cursor
from .core import (
IDENTIFIER,
Expand All @@ -25,10 +25,13 @@
SessionModel,
SessionStatusModel,
TotalProtDataset,
app_name,
create_fullprofiles,
create_identity_conversion,
create_marker_profiles,
create_markerlist,
readthedocs_url,
repository_url,
write_class_changes_reports,
write_comparison_reports,
write_global_changes_reports,
Expand Down
3 changes: 1 addition & 2 deletions src/ccompass/settings_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import FreeSimpleGUI as sg

from . import app_name
from .core import AppSettings
from .core import AppSettings, app_name


def show_settings_dialog(settings: AppSettings) -> None:
Expand Down

0 comments on commit 99251d2

Please sign in to comment.