-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ufuncs module into lib module (#48)
- Loading branch information
1 parent
f583d8e
commit 808539d
Showing
16 changed files
with
228 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
from . import ufuncs | ||
from . import lib | ||
|
||
__all__ = ["interpolate", "line_merge", "project", "shared_paths"] | ||
|
||
|
||
def interpolate(line, normalize=False): | ||
if normalize: | ||
return ufuncs.interpolate_normalized(line) | ||
return lib.interpolate_normalized(line) | ||
else: | ||
return ufuncs.interpolate(line) | ||
return lib.interpolate(line) | ||
|
||
|
||
def line_merge(lines): | ||
return ufuncs.line_merge(lines) | ||
return lib.line_merge(lines) | ||
|
||
|
||
def project(line, other, normalize=False): | ||
if normalize: | ||
return ufuncs.project_normalized(line, other) | ||
return lib.project_normalized(line, other) | ||
else: | ||
return ufuncs.project(line, other) | ||
return lib.project(line, other) | ||
|
||
|
||
def shared_paths(a, b=None, axis=0): | ||
if b is None: | ||
return ufuncs.shared_paths.reduce(a, axis=axis) | ||
return lib.shared_paths.reduce(a, axis=axis) | ||
else: | ||
return ufuncs.shared_paths(a, b) | ||
return lib.shared_paths(a, b) |
Oops, something went wrong.