Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
D2O
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
D2O
Commits
083f6433
Commit
083f6433
authored
May 02, 2017
by
Theo Steininger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ported to keepers.Logging.
parent
8c7d198b
Pipeline
#11901
passed with stage
in 7 minutes and 9 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
228 deletions
+85
-228
d2o/distributed_data_object.py
d2o/distributed_data_object.py
+12
-19
d2o/distributor_factory.py
d2o/distributor_factory.py
+72
-208
d2o/version.py
d2o/version.py
+1
-1
No files found.
d2o/distributed_data_object.py
View file @
083f6433
...
...
@@ -17,7 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
numpy
as
np
from
keepers
import
Versionable
from
keepers
import
Versionable
,
\
Loggable
from
d2o.config
import
configuration
as
gc
,
\
dependency_injector
as
gdi
...
...
@@ -29,13 +30,8 @@ from strategies import STRATEGIES
MPI
=
gdi
[
gc
[
'mpi_module'
]]
about_cstring
=
lambda
z
:
z
from
sys
import
stdout
about_warnings_cprint
=
lambda
z
:
stdout
.
write
(
z
+
"
\n
"
);
stdout
.
flush
()
about_infos_cprint
=
lambda
z
:
stdout
.
write
(
z
+
"
\n
"
);
stdout
.
flush
()
class
distributed_data_object
(
Versionable
,
object
):
class
distributed_data_object
(
Loggable
,
Versionable
,
object
):
"""A multidimensional array with modular MPI-based distribution schemes.
The purpose of a distributed_data_object (d2o) is to provide the user
...
...
@@ -429,8 +425,7 @@ class distributed_data_object(Versionable, object):
try
:
result_data
=
function
(
local_data
)
except
:
about_warnings_cprint
(
"WARNING: Trying to use np.vectorize!"
)
self
.
logger
.
warn
(
"Trying to use np.vectorize!"
)
result_data
=
np
.
vectorize
(
function
,
otypes
=
[
local_data
.
dtype
])(
local_data
)
...
...
@@ -1221,11 +1216,9 @@ class distributed_data_object(Versionable, object):
"""
if
0
in
self
.
shape
:
raise
ValueError
(
"ERROR: attempt to get argmin of an empty object"
)
raise
ValueError
(
"Attempt to get argmin of an empty object"
)
if
axis
is
not
None
:
raise
NotImplementedError
(
"ERROR: argmin doesn't support axis "
"keyword"
)
raise
NotImplementedError
(
"argmin doesn't support axis keyword"
)
if
self
.
shape
==
():
return
0
...
...
@@ -1259,9 +1252,9 @@ class distributed_data_object(Versionable, object):
if
0
in
self
.
shape
:
raise
ValueError
(
"
ERROR: a
ttempt to get argmax of an empty object"
)
"
A
ttempt to get argmax of an empty object"
)
if
axis
is
not
None
:
raise
NotImplementedError
(
"
ERROR:
argmax doesn't support axis "
raise
NotImplementedError
(
"argmax doesn't support axis "
"keyword"
)
if
self
.
shape
==
():
return
0
...
...
@@ -1337,8 +1330,8 @@ class distributed_data_object(Versionable, object):
expensive.
"""
about_warnings_cprint
(
"WARNING: The current implementation of median is very
expensive!"
)
self
.
logger
.
warn
(
"The current implementation of median is very "
"
expensive!"
)
median
=
np
.
median
(
self
.
get_full_data
(),
axis
=
axis
,
**
kwargs
)
if
np
.
isscalar
(
median
):
return
median
...
...
@@ -1473,8 +1466,8 @@ class distributed_data_object(Versionable, object):
if
self
.
dtype
not
in
[
np
.
dtype
(
'int16'
),
np
.
dtype
(
'int32'
),
np
.
dtype
(
'int64'
),
np
.
dtype
(
'uint16'
),
np
.
dtype
(
'uint32'
),
np
.
dtype
(
'uint64'
)]:
raise
TypeError
(
about_cstring
(
"ERROR: Distributed-data-object must be of integer datatype!"
)
)
raise
TypeError
(
"Distributed-data-object must be of integer "
"datatype!"
)
if
axis
is
():
return
self
.
copy
()
...
...
d2o/distributor_factory.py
View file @
083f6433
This diff is collapsed.
Click to expand it.
d2o/version.py
View file @
083f6433
...
...
@@ -20,4 +20,4 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__
=
'1.
0.8
'
__version__
=
'1.
1.0
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment