Skip to content

Commit

Permalink
docs: fix example code
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Mar 14, 2018
1 parent bbe11a8 commit 803b8b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/convert_txt2npy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class for a very unique data set. In this example, QPI data,


def get_paths(folder):
"""Return *_phase.txt files in `folder`"""
'''Return *_phase.txt files in `folder`'''
folder = pathlib.Path(folder).resolve()
files = folder.rglob("*_phase.txt")
return sorted(files)


def load_file(path):
"""Load a txt data file"""
'''Load a txt data file'''
path = pathlib.Path(path)
data = path.open().readlines()
# remove comments and empty lines
Expand All @@ -42,7 +42,7 @@ def load_file(path):


def load_field(path):
"""Load QPI data using *_phase.txt files"""
'''Load QPI data using *_phase.txt files'''
path = pathlib.Path(path)
phase = load_file(path)
inten = load_file(path.parent / (path.name[:-10] + "_intensity.txt"))
Expand Down
4 changes: 2 additions & 2 deletions examples/convert_txt2tif.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def get_paths(folder, ignore_endswith=ignore_endswith):
"""Return hologram file paths
'''Return hologram file paths
Parameters
----------
Expand All @@ -34,7 +34,7 @@ def get_paths(folder, ignore_endswith=ignore_endswith):
ignore_endswith: list
List of filename ending strings indicating which
files should be ignored.
"""
'''
folder = pathlib.Path(folder).resolve()
files = folder.rglob("*")
for ie in ignore_endswith:
Expand Down

0 comments on commit 803b8b6

Please sign in to comment.