Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
6698f9c7
Commit
6698f9c7
authored
Feb 09, 2017
by
Theo Steininger
Browse files
Refactored import structure in probing classes.
Added probing.py in demos folder.
parent
2e5af433
Pipeline
#10069
failed with stages
in 16 minutes and 26 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/__init__.py
View file @
6698f9c7
...
...
@@ -55,7 +55,7 @@ from spaces import *
from
operators
import
*
#
from probing import *
from
probing
import
*
from
sugar
import
*
...
...
nifty/probing/mixin_classes/diagonal_prober_mixin.py
View file @
6698f9c7
# -*- coding: utf-8 -*-
from
mixin_base
import
MixinBase
class
DiagonalProberMixin
(
MixinBase
):
def
__init__
(
self
):
class
DiagonalProberMixin
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
reset
()
super
(
DiagonalProberMixin
,
self
).
__init__
()
super
(
DiagonalProberMixin
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
reset
(
self
):
self
.
__sum_of_probings
=
0
...
...
nifty/probing/mixin_classes/mixin_base.py
deleted
100644 → 0
View file @
2e5af433
# -*- coding: utf-8 -*-
class
MixinBase
(
object
):
def
reset
(
self
,
*
args
,
**
kwargs
):
pass
def
finish_probe
(
self
,
*
args
,
**
kwargs
):
pass
nifty/probing/mixin_classes/trace_prober_mixin.py
View file @
6698f9c7
# -*- coding: utf-8 -*-
from
mixin_base
import
MixinBase
class
TraceProberMixin
(
MixinBase
):
def
__init__
(
self
):
class
TraceProberMixin
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
reset
()
super
(
TraceProberMixin
,
self
).
__init__
()
super
(
TraceProberMixin
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
reset
(
self
):
self
.
__sum_of_probings
=
0
...
...
nifty/probing/prober/prober.py
View file @
6698f9c7
...
...
@@ -34,8 +34,6 @@ class Prober(object):
self
.
_random_type
=
self
.
_parse_random_type
(
random_type
)
self
.
compute_variance
=
bool
(
compute_variance
)
super
(
Prober
,
self
).
__init__
()
# ---Properties---
@
property
...
...
@@ -84,7 +82,7 @@ class Prober(object):
self
.
finish_probe
(
current_probe
,
pre_result
)
def
reset
(
self
):
super
(
Prober
,
self
).
reset
()
pass
def
get_probe
(
self
,
index
):
""" layer of abstraction for potential probe-caching """
...
...
@@ -107,7 +105,7 @@ class Prober(object):
return
callee
(
probe
,
**
kwargs
)
def
finish_probe
(
self
,
probe
,
pre_result
):
super
(
Prober
,
self
).
finish_probe
(
probe
,
pre_result
)
pass
def
__call__
(
self
,
callee
):
return
self
.
probing_run
(
callee
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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