-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
181 changed files
with
23,430 additions
and
3,935 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
Empty file.
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 |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
import math | ||
import time | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
|
Empty file.
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,83 @@ | ||
""" | ||
Contains several very basic apps to test python function reproducibility. | ||
""" | ||
import numpy as np | ||
|
||
from dlg.apps.pyfunc import PyFuncApp | ||
|
||
|
||
def write_in(): | ||
""" | ||
:return: "world" always | ||
""" | ||
return "world" | ||
|
||
|
||
def write_out(phrase="everybody"): | ||
""" | ||
Appends s to "Hello " | ||
:param phrase: The string to be appended | ||
:return: "Hello " + s | ||
""" | ||
return "Hello " + phrase | ||
|
||
|
||
def numpy_av(nums): | ||
""" | ||
Finds the mean of a list of numbers using numpy. | ||
:param nums: The numbers to be averaged. | ||
:return: The mean. | ||
""" | ||
return np.asscalar(np.mean(nums)) | ||
|
||
|
||
def my_av(nums): | ||
""" | ||
Finds the mean of a list of numbers manually | ||
:param nums: The numbers to be averaged | ||
:return: The mean. | ||
""" | ||
res = 0.0 | ||
for num in nums: | ||
res += num | ||
return res / len(nums) | ||
|
||
|
||
class HelloWorldPythonIn(PyFuncApp): | ||
""" | ||
Wrapper app turning writeIn into a Python function app | ||
""" | ||
|
||
def initialize(self, **kwargs): | ||
fname = "dlg.common.reproducibility.apps.write_in" | ||
super().initialize(func_name=fname) | ||
|
||
|
||
class HelloWorldPythonOut(PyFuncApp): | ||
""" | ||
Wrapper app turning writeOut into a Python function app | ||
""" | ||
|
||
def initialize(self, **kwargs): | ||
fname = "dlg.common.reproducibility.apps.write_out" | ||
super().initialize(func_name=fname) | ||
|
||
|
||
class NumpyAverage(PyFuncApp): | ||
""" | ||
Wrapper app turning numpy_av into a Python function app | ||
""" | ||
|
||
def initialize(self, **kwargs): | ||
fname = "dlg.common.reproducibility.apps.numpy_av" | ||
super().initialize(func_name=fname) | ||
|
||
|
||
class MyAverage(PyFuncApp): | ||
""" | ||
Wrapper app turning my_av into a Python function app | ||
""" | ||
|
||
def initialize(self, **kwargs): | ||
fname = "dlg.common.reproducibility.apps.my_av" | ||
super().initialize(func_name=fname) |
Oops, something went wrong.