Skip to content

Commit

Permalink
Improve type checking in conversions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CalCraven committed Oct 1, 2024
1 parent 9ff6cb7 commit 68141a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gmso/utils/conversions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module for standard conversions needed in molecular simulations."""

from __future__ import annotations
from typing import TYPE_CHECKING
import re
from functools import lru_cache

Expand All @@ -9,7 +10,9 @@
import unyt as u
from unyt.dimensions import length, mass, time

import gmso
if TYPE_CHECKING:
import gmso

from gmso.exceptions import EngineIncompatibilityError, GMSOError
from gmso.lib.potential_templates import (
PotentialTemplate,
Expand Down Expand Up @@ -57,7 +60,7 @@ def _try_sympy_conversions(pot1, pot2):

def _conversion_from_template_name(
top, connStr: str, conn_typeStr: str, convStr: str
) -> gmso.Topology:
) -> 'gmso.Topology':
"""Use the name of convStr to identify function to convert sympy expressions."""
conversions_map = { # these are predefined between template types
# More functions, and `(to, from)` key pairs added to this dictionary
Expand Down Expand Up @@ -101,7 +104,7 @@ def _conversion_from_template_name(


def _conversion_from_template_obj(
top: gmso.Topology,
top: 'gmso.Topology',
connStr: str,
conn_typeStr: str,
potential_template: gmso.core.ParametricPotential,
Expand Down

0 comments on commit 68141a4

Please sign in to comment.