Skip to content
GitLab
Menu
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
3c9e8c4a
Commit
3c9e8c4a
authored
Jul 03, 2017
by
Martin Reinecke
Browse files
remove basic_arithmetics
parent
2a7ee176
Pipeline
#14290
passed with stage
in 5 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/__init__.py
View file @
3c9e8c4a
...
@@ -38,8 +38,6 @@ from field import Field
...
@@ -38,8 +38,6 @@ from field import Field
from
random
import
Random
from
random
import
Random
from
basic_arithmetics
import
*
from
nifty_utilities
import
*
from
nifty_utilities
import
*
from
field_types
import
*
from
field_types
import
*
...
...
nifty/basic_arithmetics.py
deleted
100644 → 0
View file @
2a7ee176
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
import
numpy
as
np
from
d2o
import
distributed_data_object
from
nifty.field
import
Field
__all__
=
[
'cos'
,
'sin'
,
'cosh'
,
'sinh'
,
'tan'
,
'tanh'
,
'arccos'
,
'arcsin'
,
'arccosh'
,
'arcsinh'
,
'arctan'
,
'arctanh'
,
'sqrt'
,
'exp'
,
'log'
,
'conjugate'
]
def
_math_helper
(
x
,
function
):
if
isinstance
(
x
,
Field
):
result_val
=
x
.
val
.
apply_scalar_function
(
function
)
result
=
x
.
copy_empty
(
dtype
=
result_val
.
dtype
)
result
.
val
=
result_val
elif
isinstance
(
x
,
distributed_data_object
):
result
=
x
.
apply_scalar_function
(
function
,
inplace
=
False
)
else
:
result
=
function
(
np
.
asarray
(
x
))
return
result
def
cos
(
x
):
return
_math_helper
(
x
,
np
.
cos
)
def
sin
(
x
):
return
_math_helper
(
x
,
np
.
sin
)
def
cosh
(
x
):
return
_math_helper
(
x
,
np
.
cosh
)
def
sinh
(
x
):
return
_math_helper
(
x
,
np
.
sinh
)
def
tan
(
x
):
return
_math_helper
(
x
,
np
.
tan
)
def
tanh
(
x
):
return
_math_helper
(
x
,
np
.
tanh
)
def
arccos
(
x
):
return
_math_helper
(
x
,
np
.
arccos
)
def
arcsin
(
x
):
return
_math_helper
(
x
,
np
.
arcsin
)
def
arccosh
(
x
):
return
_math_helper
(
x
,
np
.
arccosh
)
def
arcsinh
(
x
):
return
_math_helper
(
x
,
np
.
arcsinh
)
def
arctan
(
x
):
return
_math_helper
(
x
,
np
.
arctan
)
def
arctanh
(
x
):
return
_math_helper
(
x
,
np
.
arctanh
)
def
sqrt
(
x
):
return
_math_helper
(
x
,
np
.
sqrt
)
def
exp
(
x
):
return
_math_helper
(
x
,
np
.
exp
)
def
log
(
x
,
base
=
None
):
result
=
_math_helper
(
x
,
np
.
log
)
if
base
is
not
None
:
result
=
result
/
log
(
base
)
return
result
def
conjugate
(
x
):
return
_math_helper
(
x
,
np
.
conjugate
)
def
conj
(
x
):
return
_math_helper
(
x
,
np
.
conjugate
)
nifty/operators/diagonal_operator/diagonal_operator.py
View file @
3c9e8c4a
...
@@ -21,7 +21,6 @@ import numpy as np
...
@@ -21,7 +21,6 @@ import numpy as np
from
d2o
import
distributed_data_object
,
\
from
d2o
import
distributed_data_object
,
\
STRATEGIES
as
DISTRIBUTION_STRATEGIES
STRATEGIES
as
DISTRIBUTION_STRATEGIES
from
nifty.basic_arithmetics
import
log
as
nifty_log
from
nifty.config
import
nifty_configuration
as
gc
from
nifty.config
import
nifty_configuration
as
gc
from
nifty.field
import
Field
from
nifty.field
import
Field
from
nifty.operators.endomorphic_operator
import
EndomorphicOperator
from
nifty.operators.endomorphic_operator
import
EndomorphicOperator
...
...
Martin Reinecke
@mtr
mentioned in commit
bf3fa555
·
Jul 06, 2017
mentioned in commit
bf3fa555
mentioned in commit bf3fa55598c64c3dddc8160ce0ad5535dfd54631
Toggle commit list
Write
Preview
Supports
Markdown
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