Skip to content

Commit

Permalink
remove added docstrings on autogen code files
Browse files Browse the repository at this point in the history
  • Loading branch information
klmcadams committed Jan 31, 2024
1 parent d23fded commit c867e42
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 102 deletions.
98 changes: 15 additions & 83 deletions src/ansys/hps/client/auth/api/auth_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@


class AuthApi:
"""
Provides the Python interface to the Authorization Service API.
"""Provides the Python interface to the Authorization Service API.
Admin users with the Keycloak "manage-users" role can create
users as well as modify or delete existing users. Non-admin users are only allowed
Expand Down Expand Up @@ -65,6 +64,7 @@ class AuthApi:
... last_name="User",
... )
>>> auth_api.create_user(new_user)
"""

def __init__(self, client):
Expand All @@ -81,8 +81,7 @@ def keycloak_admin_client(self) -> KeycloakAdmin:
return _admin_client(self.client)

def get_users(self, as_objects=True, **query_params) -> List[User]:
"""
Get users, filtered according to query parameters.
"""Get users, filtered according to query parameters.
Examples of query parameters are:
- ``username``
Expand All @@ -97,68 +96,19 @@ def get_users(self, as_objects=True, **query_params) -> List[User]:
return get_users(self.keycloak_admin_client, as_objects=as_objects, **query_params)

def get_user(self, id: str) -> User:
"""
Get the user representation for a given user ID.
Parameters
----------
id : str
User ID.
Returns
-------
User
User object.
"""
"""Get the user representation for a given user ID."""
return get_user(self.keycloak_admin_client, id)

def get_user_groups(self, id: str) -> List[str]:
"""
Get the groups that the user belongs to.
Parameters
----------
id : str
User ID.
Returns
-------
List[str]
List of groups the user belongs to.
"""
"""Get the groups that the user belongs to."""
return [g["name"] for g in self.keycloak_admin_client.get_user_groups(id)]

def get_user_realm_roles(self, id: str) -> List[str]:
"""
Get the realm roles for the user.
Parameters
----------
id : str
User ID.
Returns
-------
List[str]
List of realm roles for the user.
"""
"""Get the realm roles for the user."""
return [r["name"] for r in self.keycloak_admin_client.get_realm_roles_of_user(id)]

def user_is_admin(self, id: str) -> bool:
"""
Determine if the user is a system administrator.
Parameters
----------
id : str
User ID.
Returns
-------
bool
``True`` if the user is a system administrator.
``False`` if the user is not a system administrator.
"""
"""Determine if the user is a system administrator."""

from ansys.hps.client.jms import JmsApi

Expand All @@ -180,44 +130,31 @@ def user_is_admin(self, id: str) -> bool:
return False

def create_user(self, user: User, as_objects=True) -> User:
"""
Create a user.
"""Create a user.
Parameters
----------
user : :class:`ansys.hps.client.auth.User`
User object. The default is ``None``.
as_objects : bool, optional
The default is ``True``.
Returns
-------
User
User object.
"""
return create_user(self.keycloak_admin_client, user, as_objects=as_objects)

def update_user(self, user: User, as_objects=True) -> User:
"""
Modify an existing user.
"""Modify an existing user.
Parameters
----------
user : :class:`ansys.hps.client.auth.User`
User object. The default is ``None``.
as_objects : bool, optional
The default is ``True``.
Returns
-------
User
User object.
"""
return update_user(self.keycloak_admin_client, user, as_objects=as_objects)

def delete_user(self, user: User) -> None:
"""
Delete an existing user.
"""Delete an existing user.
Parameters
----------
Expand All @@ -228,8 +165,7 @@ def delete_user(self, user: User) -> None:


def _admin_client(client):
"""
Set information for admin.
"""Set information for admin.
Parameters
----------
Expand All @@ -253,8 +189,7 @@ def _admin_client(client):


def get_users(admin_client: KeycloakAdmin, as_objects=True, **query_params):
"""
Get users as admin.
"""Get users as admin.
Parameters
----------
Expand All @@ -271,8 +206,7 @@ def get_users(admin_client: KeycloakAdmin, as_objects=True, **query_params):


def get_user(admin_client: KeycloakAdmin, id: str, as_objects=True):
"""
Get user using ID.
"""Get user using ID.
Parameters
----------
Expand All @@ -291,8 +225,7 @@ def get_user(admin_client: KeycloakAdmin, id: str, as_objects=True):


def create_user(admin_client: KeycloakAdmin, user: User, as_objects=True):
"""
Create user.
"""Create user.
Parameters
----------
Expand All @@ -319,8 +252,7 @@ def create_user(admin_client: KeycloakAdmin, user: User, as_objects=True):


def update_user(admin_client: KeycloakAdmin, user: User, as_objects=True):
"""
Update user.
"""Update user.
Parameters
----------
Expand Down
4 changes: 1 addition & 3 deletions src/ansys/hps/client/auth/resource/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the user resource."""
# autogenerated code
from marshmallow.utils import missing

Expand All @@ -29,8 +28,7 @@


class User(Object):
"""
Provides the user resource.
"""Provides the user resource.
Parameters
----------
Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the evaluator resource and updating its configuration."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing a job resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the job definition resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/license_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the license context resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the operation resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
2 changes: 0 additions & 2 deletions src/ansys/hps/client/jms/resource/parameter_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the float, integer, boolean, and string parameter definition resources."""

# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/parameter_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the parameter mapping resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the permission resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the project resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the job selection resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
1 change: 0 additions & 1 deletion src/ansys/hps/client/jms/resource/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the task resource."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
2 changes: 0 additions & 2 deletions src/ansys/hps/client/jms/resource/task_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the HPC, resource requirements, software, success criteria,
licensing, and task definition resources."""
# autogenerated code
from marshmallow.utils import missing

Expand Down
2 changes: 0 additions & 2 deletions src/ansys/hps/client/jms/resource/task_definition_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module providing the template property, template resource requirements,
template input file, template output file, and task definition template resources."""
# autogenerated code
from marshmallow.utils import missing

Expand Down

0 comments on commit c867e42

Please sign in to comment.