Skip to content

Commit e6a771f

Browse files
committed
Move NodeTypeInfo into the cloud module
1 parent 9968672 commit e6a771f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

citc/aws.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import boto3
66
from mypy_boto3_ec2 import EC2Client
77

8-
from .cloud import CloudNode, NodeState
9-
from .utils import NodeTypeInfo
8+
from .cloud import CloudNode, NodeState, NodeTypeInfo
109

1110

1211
class NodeNotFound(Exception):

citc/cloud.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import ABC, abstractmethod
22
from enum import Enum, auto
3+
from typing import TypedDict, Optional
34

45

56
class NodeState(Enum):
@@ -45,3 +46,10 @@ def __init__(self, name, state, ip):
4546
@abstractmethod
4647
def all(cls, client, nodespace: dict):
4748
pass
49+
50+
51+
class NodeTypeInfo(TypedDict):
52+
memory: int
53+
cores_per_socket: int
54+
threads_per_core: int
55+
arch: Optional[str]

citc/utils.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, List, TypedDict, Optional
1+
from typing import Dict, List
22

33
import yaml
44

@@ -39,14 +39,7 @@ def get_cloud_nodes() -> List[cloud.CloudNode]:
3939
return cloud_nodes
4040

4141

42-
class NodeTypeInfo(TypedDict):
43-
memory: int
44-
cores_per_socket: int
45-
threads_per_core: int
46-
arch: Optional[str]
47-
48-
49-
def get_types_info() -> Dict[str, NodeTypeInfo]:
42+
def get_types_info() -> Dict[str, cloud.NodeTypeInfo]:
5043
"""
5144
Returns:
5245
list: a list of node info dictionaries

0 commit comments

Comments
 (0)