Skip to content

Commit f7be37e

Browse files
committed
move compile_python test; fix docstrings
1 parent bbfcd0f commit f7be37e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

linkml_runtime/utils/compile_python.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77
def file_text(txt_or_fname: str) -> str:
88
"""
99
Determine whether text_or_fname is a file name or a string and, if a file name, read it
10-
:param txt_or_fname:
11-
:return:
10+
11+
:param txt_or_fname: Text content or filename to read
12+
:return: File content as string
1213
"""
1314
if len(txt_or_fname) > 4 and '\n' not in txt_or_fname:
1415
with open(txt_or_fname) as ef:
1516
return ef.read()
1617
return txt_or_fname
1718

1819

19-
def compile_python(text_or_fn: str, package_path: str | None = None, module_name: str | None = None) -> ModuleType:
20+
def compile_python(text_or_fn: str, package_path: str = None, module_name: str = None) -> ModuleType:
2021
"""
2122
Compile the text or file and return the resulting module
22-
@param text_or_fn: Python text or file name that references python file
23-
@param package_path: Root package path. If omitted and we've got a python file, the package is the containing directory
24-
@param module_name: to be used in an import statement, default 'test'
25-
@return: Compiled module
23+
24+
:param text_or_fn: Python text or file name that references python file
25+
:param package_path: Root package path. If omitted and we've got a python file, the package is the containing directory
26+
:param module_name: Module name to be used in an import statement, default 'test'
27+
:return: Compiled module
2628
"""
2729
if module_name is None:
2830
module_name = "test"
File renamed without changes.

0 commit comments

Comments
 (0)