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
Daniel Boeckenhoff
tfields
Commits
434133fc
Commit
434133fc
authored
Aug 07, 2018
by
Daniel Boeckenhoff
Browse files
nothing much
parent
ad2b38a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
434133fc
...
...
@@ -11,21 +11,26 @@ Publishing:
"""
from
setuptools
import
setup
,
find_packages
exec
file
(
'...
tfields/__about__.py
'
)
exec
(
open
(
"./
tfields/__about__.py
"
).
read
()
)
setup
(
name
=
'tfields'
,
name
=
__title__
,
version
=
__version__
,
description
=
'numpy + sympy implementation of tensor fields with attached coordinate systems'
,
description
=
__summary__
,
author
=
__author__
,
author_email
=
__email__
,
license
=
__license__
,
keywords
=
__keywords__
,
packages
=
find_packages
(),
url
=
__uri__
,
project_urls
=
{
'Documentation'
:
__uri__
,
'Source'
:
__uri__
,
},
test_require
=
[
'doctest'
,
'unittest'
],
url
=
'https://gitlab.mpcdf.mpg.de/dboe/tfields'
,
install_requires
=
[
'numpy'
,
'sympy'
,
...
...
@@ -62,12 +67,6 @@ setup(
'Programming Language :: Python :: 3.6'
],
python_requires
=
'>=2.7'
,
keywords
=
"tensors coordinate system trafo sympy numpy"
,
project_urls
=
{
'Documentation'
:
'https://gitlab.mpcdf.mpg.de/dboe/tfields/'
,
'Source'
:
'https://gitlab.mpcdf.mpg.de/dboe/tfields/'
,
# 'Tracker': 'https://github.com/pypa/sampleproject/issues',
}
)
...
...
tfields/__about__.py
View file @
434133fc
__version__
=
'0.1.0.dev8'
__all__
=
[
"__version__"
,
"__title__"
,
"__summary__"
,
"__keywords__"
,
"__uri__"
,
"__author__"
,
"__email__"
,
"__license__"
,
"__copyright__"
,
]
__version__
=
'0.1.0.dev9'
__title__
=
'tfields'
__summary__
=
"numpy + sympy implementation of tensor fields with attached coordinate systems"
__keywords__
=
"tensors coordinate system trafo sympy numpy"
__uri__
=
'https://gitlab.mpcdf.mpg.de/dboe/tfields'
__author__
=
"Daniel Boeckenhoff"
__email__
=
"daniel.boeckenhoff@ipp.mpg.de"
__license__
=
"Apache License, Version 2.0"
...
...
tfields/core.py
View file @
434133fc
...
...
@@ -208,8 +208,11 @@ class AbstractNdarray(np.ndarray):
... remaining:forwarded to extension specific method
"""
# get the extension
if
isinstance
(
path
,
string_types
):
if
isinstance
(
path
,
(
string_types
,
pathlib
.
Path
)
):
extension
=
pathlib
.
Path
(
path
).
suffix
.
lstrip
(
'.'
)
else
:
raise
ValueError
(
"Wrong path type {0}"
.
format
(
type
(
path
)))
path
=
str
(
path
)
# get the save method
try
:
...
...
@@ -219,8 +222,7 @@ class AbstractNdarray(np.ndarray):
raise
NotImplementedError
(
"Can not find save method for extension: "
"{extension}."
.
format
(
**
locals
()))
# resolve: relative paths, symlinks and ~
path
=
os
.
path
.
realpath
(
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
path
)))
path
=
tfields
.
lib
.
in_out
.
resolve
(
path
)
return
save_method
(
path
,
**
kwargs
)
@
classmethod
...
...
@@ -235,10 +237,12 @@ class AbstractNdarray(np.ndarray):
extension (str): only needed if path is buffer
... remaining:forwarded to extension specific method
"""
extension
=
kwargs
.
pop
(
'extension'
,
'npz'
)
if
isinstance
(
path
,
string_types
):
path
=
os
.
path
.
realpath
(
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
path
)))
if
isinstance
(
path
,
(
string_types
,
pathlib
.
Path
)):
extension
=
pathlib
.
Path
(
path
).
suffix
.
lstrip
(
'.'
)
path
=
str
(
path
)
path
=
tfields
.
lib
.
in_out
.
resolve
(
path
)
else
:
extension
=
kwargs
.
pop
(
'extension'
,
'npz'
)
try
:
load_method
=
getattr
(
cls
,
'_load_{e}'
.
format
(
e
=
extension
))
...
...
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