-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! python: rewrite Python high level API in python
- Loading branch information
1 parent
d39b56e
commit 88af23d
Showing
11 changed files
with
338 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,61 @@ | ||
import adios2.bindings | ||
"""License: | ||
Distributed under the OSI-approved Apache License, Version 2.0. See | ||
accompanying file Copyright.txt for details. | ||
""" | ||
|
||
|
||
class Attribute: | ||
"""High level representation of the Attribute class in the adios2.bindings""" | ||
|
||
def __init__(self, io, name, *args, **kwargs): | ||
self._impl = io.DefineAttribute(name, *args, **kwargs) | ||
self.impl = io.DefineAttribute(name, *args, **kwargs) | ||
|
||
@property | ||
def impl(self): | ||
"""Bindings implementation of the class""" | ||
return self._impl | ||
|
||
@impl.setter | ||
def impl(self, implementation): | ||
self._impl = implementation | ||
|
||
def __eq__(self, other): | ||
if isinstance(other, Attribute): | ||
return self.name() == other.name() | ||
return False | ||
|
||
def name(self): | ||
return self._impl.Name() | ||
""" | ||
Name of the Attribute | ||
Returns: | ||
Name of the Attribute as a str. | ||
""" | ||
return self.impl.Name() | ||
|
||
def type(self): | ||
return self._impl.Type() | ||
""" | ||
Type of the Attribute | ||
Returns: | ||
Type of the Attribute as a str. | ||
""" | ||
return self.impl.Type() | ||
|
||
def data(self): | ||
return self._impl.Data() | ||
""" | ||
Content of the Attribute | ||
Returns: | ||
Content of the Attribute as a non string. | ||
""" | ||
return self.impl.Data() | ||
|
||
def data_string(self): | ||
return self._impl.DataString() | ||
""" | ||
Content of the Attribute | ||
Returns: | ||
Content of the Attribute as a str. | ||
""" | ||
return self.impl.DataString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,45 @@ | ||
import adios2.bindings | ||
"""License: | ||
Distributed under the OSI-approved Apache License, Version 2.0. See | ||
accompanying file Copyright.txt for details. | ||
""" | ||
|
||
|
||
class Operator: | ||
def __init__(self, impl, name): | ||
self._impl = impl | ||
"""High level representation of the Attribute class in the adios2.bindings""" | ||
|
||
def __init__(self, implementation, name): | ||
self.impl = implementation | ||
self._name = name | ||
|
||
@property | ||
def impl(self): | ||
"""Bindings implementation of the class""" | ||
return self._impl | ||
|
||
@impl.setter | ||
def impl(self, implementation): | ||
self._impl = implementation | ||
|
||
def __eq__(self, other): | ||
if isinstance(other, Operator): | ||
return self._name == other._name | ||
return False | ||
|
||
def get_parameters(self): | ||
return self._impl.Parameters() | ||
""" | ||
Get parameters associated to this Operator | ||
Returns: | ||
dict: parameters | ||
""" | ||
return self.impl.Parameters() | ||
|
||
def set_parameter(self, key, value): | ||
self._impl.SetParameter(key, value) | ||
""" | ||
Set parameter associated to this Operator | ||
Args: | ||
str: key | ||
str: value | ||
""" | ||
self.impl.SetParameter(key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.