Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90997405
tamaas.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 18:51
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Nov 8, 18:51 (2 d)
Engine
blob
Format
Raw Data
Handle
22145023
Attached To
rTAMAAS tamaas
tamaas.py
View Options
try
:
from
._tamaas
import
*
# Redefinition of model_type constants (for compatibility)
model_type_basic_1d
=
model_type
.
basic_1d
model_type_basic_2d
=
model_type
.
basic_2d
model_type_surface_1d
=
model_type
.
surface_1d
model_type_surface_2d
=
model_type
.
surface_2d
model_type_volume_1d
=
model_type
.
volume_1d
model_type_volume_2d
=
model_type
.
volume_2d
except
ImportError
as
e
:
print
(
"Error trying to import _tamaas:
\n
{}"
.
format
(
e
))
raise
e
class
ParamHelper
:
def
__init__
(
self
,
obj
):
self
.
obj
=
obj
def
set
(
self
,
params
):
for
key
in
params
:
setter_name
=
'set'
+
key
try
:
accessor
=
getattr
(
self
.
obj
,
setter_name
)
accessor
(
params
[
key
])
except
:
print
(
"Setter '{}({})' does not exist for object {}"
.
format
(
setter_name
,
type
(
params
[
key
]),
self
.
obj
))
Event Timeline
Log In to Comment