Skip to content

Modify convert functions to be async functions #149

@daniel-kinney-seequent

Description

@daniel-kinney-seequent

Summary

The converters use make use the async Evo SDK objects. This means they have to run with an event loop. Typically that can be done with asyncio.run(...). That doesn't work for the converters when they are run from jupyter, because it runs its own event loop, and asyncio is not allowing the event loop to be re-entered or for a new one to be created. We used nest_asyncio to try to sidestep this issue, but that caused problems. nest_asyncio was working for a while, but it stopped working when we tried using the converter in the context of a more sophisticated notebook widget.

The potential ways to solve this problem are:

  1. Make the converter functions async, so that they can use jupyter's event loop.
  2. Encapsulate the async Evo SDK calls, putting them on another thread with their own event loop.
  3. Avoid calling async function on the Evo SDK

The decision was made to do (1).

Acceptance Criteria

[ ] All converters have async functions
[ ] The synchronous publish_geoscience_objects_sync is removed
[ ] nest_asyncio is removed from the repository, both its references and as a dependency
[ ] Make network operations concurrent where applicable. For example, use a gather in publish_geoscience_objects.

Out of Scope

DUF (it has already been done by this point)

Definition of Done

  • All acceptance criteria met
  • Code reviewed and approved by maintainers
  • Documentation complete and reviewed
  • Tests passing in CI/CD pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions