Skip to content

Remove try..except in import for service classesΒ #501

@ansjmoody

Description

@ansjmoody

πŸ“ Description of the feature

In order to reduce errors and clean up the code, it is desired to change the try..except used for importing service classes to import the service classes from ansys.api.sherlock.v0.

E.g. in model.py:
try:
import SherlockModelService_pb2
from SherlockModelService_pb2 import MeshType, TraceOutputType
import SherlockModelService_pb2_grpc
except ModuleNotFoundError:
from ansys.api.sherlock.v0 import SherlockModelService_pb2
from ansys.api.sherlock.v0.SherlockModelService_pb2 import MeshType, TraceOutputType
from ansys.api.sherlock.v0 import SherlockModelService_pb2_grpc

Change this to:
from ansys.api.sherlock.v0 import SherlockModelService_pb2
from ansys.api.sherlock.v0.SherlockModelService_pb2 import MeshType, TraceOutputType
from ansys.api.sherlock.v0 import SherlockModelService_pb2_grpc

πŸ’‘ Steps for implementing the feature

No response

πŸ”— Useful links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenancePackage and maintenance related

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions