Skip to content

Commit 432c3e6

Browse files
committed
fix read_config
1 parent 39bd6a7 commit 432c3e6

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

pytheus/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.2.4'
1+
__version__ = '1.2.5'

pytheus/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ def analyze(which_directory, all_weights_plus_minus_one,
8686
def list():
8787
"""List all included examples."""
8888
configs_dir = pkg_resources.resource_filename(pytheus.__name__, 'graphs')
89-
files = sorted(os.listdir(configs_dir))
90-
9189
walk = os.walk(configs_dir)
9290
for root, dirs, files in walk:
9391
for file in files:
9492
if file.startswith('config'):
9593
click.echo(
96-
print(root.split('/')[-1]))
94+
print(os.path.basename(root)))

pytheus/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,10 @@ def read_config(is_example, filename):
408408

409409
# option for running files from example folder
410410
if is_example:
411-
examples_dir = pkg_resources.resource_filename(pytheus.__name__, "graphs")
412-
for root, subdirs, files in os.walk(examples_dir):
413-
if os.path.basename(os.path.normpath(root)) == filename:
411+
configs_dir = pkg_resources.resource_filename(pytheus.__name__, "graphs")
412+
walk = os.walk(configs_dir)
413+
for root, dirs, files in walk:
414+
if os.path.basename(root) == filename:
414415
for file in files:
415416
if file.startswith('config'):
416417
filename = os.path.join(root, file)

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
author = 'artificial-scientist-lab'
1010
11-
description = 'Theseus, a highly-efficient inverse-design algorithm for quantum optical experiments'
11+
description = 'PyTheus, a highly-efficient inverse-design algorithm for quantum optical experiments'
1212
dist_name = 'pytheusQ'
1313
package_name = 'pytheus'
1414
year = '2022'
@@ -17,8 +17,7 @@
1717

1818
def get_version():
1919
content = open(Path(package_name) / '__init__.py').readlines()
20-
return "1.2.4"
21-
raise Exception('Cannot extract version string.')
20+
return "1.2.5"
2221

2322

2423
setup(

0 commit comments

Comments
 (0)