Skip to content

Commit a0646b1

Browse files
committed
Add pipeline network generation
1 parent e7ac6c7 commit a0646b1

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/diffupy/cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import networkx as nx
1212
import pybel
1313

14-
from .constants import OUTPUT, METHODS
14+
from .constants import OUTPUT, METHODS, EMOJI
1515
from .kernels import regularised_laplacian_kernel
1616

1717
logger = logging.getLogger(__name__)
@@ -60,7 +60,7 @@ def kernel(
6060
logging.basicConfig(level=logging.INFO)
6161
logger.setLevel(logging.INFO)
6262

63-
click.echo(f'Loading graph from {network}')
63+
click.secho(f'{EMOJI} Loading graph from {network} {EMOJI}')
6464

6565
# TODO Here goes a function that loads a graph using pandas from csv file and returns a networkx object
6666
# Temporary is used the PyBEL import function
@@ -73,7 +73,8 @@ def kernel(
7373
for node in nx.isolates(graph)
7474
})
7575

76-
click.echo("Calculating regulatised Laplacian kernel. This might take a while...")
76+
click.secho(f'{EMOJI} Calculating regulatised Laplacian kernel. This might take a while... {EMOJI}')
77+
7778

7879
exe_t_0 = time.time()
7980
background_mat = regularised_laplacian_kernel(graph)
@@ -87,7 +88,7 @@ def kernel(
8788

8889
running_time = exe_t_f - exe_t_0
8990

90-
click.echo(f'Kernel exported to: {output_file} in {running_time} seconds"')
91+
click.secho(f'{EMOJI} Kernel exported to: {output_file} in {running_time} seconds {EMOJI}')
9192

9293

9394
@main.command()

src/diffupy/constants.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ def ensure_output_dirs():
1717

1818
ensure_output_dirs()
1919

20-
# TODO: Change to a dictionary where keys are better explanatory terms of each methode.
21-
# ANSWER: The explanation is long and tedious, it is on diffuse.py header documentation.
22-
# Should I provide it here too?
23-
2420
# Available methods for diffusion, as a character vector
2521
# Check diffuse docs for the detailed explanation of each
2622

23+
EMOJI = "🌐"
24+
2725
METHODS = {
2826
"raw",
2927
"ml",
3028
"gm",
3129
"mc",
3230
"z",
3331
"ber_s",
34-
"ber_p"
32+
"ber_p",
3533
}

0 commit comments

Comments
 (0)