-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from maroba/v0.11.0
v0.11.0
- Loading branch information
Showing
33 changed files
with
2,050 additions
and
1,399 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ name: Checks | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
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 |
---|---|---|
|
@@ -106,3 +106,4 @@ ENV/ | |
|
||
# Visual Studio Code | ||
.vscode | ||
venv2 |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Provides an interface to obsolete classes for backward compatibility.""" | ||
|
||
from findiff import Diff | ||
from findiff.operators import FieldOperator, Identity | ||
|
||
|
||
def FinDiff(*args, **kwargs): | ||
|
||
if len(args) > 3: | ||
raise ValueError("FinDiff accepts not more than 3 positional arguments.") | ||
|
||
def diff_from_tuple(tpl): | ||
if len(tpl) == 3: | ||
axis, h, order = tpl | ||
return Diff(axis, h, **kwargs) ** order | ||
elif len(tpl) == 2: | ||
axis, h = tpl | ||
return Diff(axis, h, **kwargs) | ||
|
||
if isinstance(args[0], (list, tuple)): | ||
diffs = [] | ||
for tpl in args: | ||
diffs.append(diff_from_tuple(tpl)) | ||
fd = diffs[0] | ||
for diff in diffs[1:]: | ||
fd = fd * diff | ||
return fd | ||
|
||
return diff_from_tuple(args) | ||
|
||
|
||
# Define aliasses for backward compatibility | ||
Coefficient = Coef = FieldOperator | ||
Id = Identity |
Oops, something went wrong.