Skip to content

Commit

Permalink
all caps c s v
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Jul 26, 2024
1 parent 4762321 commit a252211
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions robot-server/robot_server/protocols/analysis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from .completed_analysis_store import CompletedAnalysisStore, CompletedAnalysisResource
from .analysis_memcache import MemoryCache
from .rtp_resources import PrimitiveParameterResource, CsvParameterResource
from .rtp_resources import PrimitiveParameterResource, CSVParameterResource

_log = getLogger(__name__)

Expand Down Expand Up @@ -345,11 +345,11 @@ def _extract_primitive_run_time_params(
@staticmethod
def _extract_csv_run_time_params(
completed_analysis: CompletedAnalysis,
) -> List[CsvParameterResource]:
) -> List[CSVParameterResource]:
"""Extract the Primitive Run Time Parameters from analysis for saving in DB."""
csv_rtp_list = completed_analysis.runTimeParameters
return [
CsvParameterResource(
CSVParameterResource(
analysis_id=completed_analysis.id,
parameter_variable_name=param.variableName,
file_id=param.file.id if param.file else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from .analysis_models import CompletedAnalysis
from .analysis_memcache import MemoryCache
from .rtp_resources import PrimitiveParameterResource, CsvParameterResource
from .rtp_resources import PrimitiveParameterResource, CSVParameterResource

_log = getLogger(__name__)

Expand Down Expand Up @@ -301,15 +301,15 @@ def get_csv_rtps_by_analysis_id(

csv_rtps: Dict[str, Optional[str]] = {}
for row in results:
param = CsvParameterResource.from_sql_row(row)
param = CSVParameterResource.from_sql_row(row)
csv_rtps.update({param.parameter_variable_name: param.file_id})
return csv_rtps

async def make_room_and_add(
self,
completed_analysis_resource: CompletedAnalysisResource,
primitive_rtp_resources: List[PrimitiveParameterResource],
csv_rtp_resources: List[CsvParameterResource],
csv_rtp_resources: List[CSVParameterResource],
) -> None:
"""Make room and add a resource to the store.
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/protocols/rtp_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def from_sql_row(


@dataclass
class CsvParameterResource:
class CSVParameterResource:
"""A CSV runtime parameter from a completed analysis, storable in a SQL database."""

analysis_id: str
Expand All @@ -77,7 +77,7 @@ def to_sql_values(self) -> Dict[str, object]:
def from_sql_row(
cls,
sql_row: sqlalchemy.engine.Row,
) -> CsvParameterResource:
) -> CSVParameterResource:
"""Extract CSV resource data from SQLAlchemy row object."""
analysis_id = sql_row.analysis_id
assert isinstance(analysis_id, str)
Expand Down
4 changes: 2 additions & 2 deletions robot-server/tests/protocols/test_analysis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)
from robot_server.protocols.rtp_resources import (
PrimitiveParameterResource,
CsvParameterResource,
CSVParameterResource,
)


Expand Down Expand Up @@ -402,7 +402,7 @@ async def test_update_adds_rtp_values_to_completed_store(
),
],
csv_rtp_resources=[
CsvParameterResource(
CSVParameterResource(
analysis_id="analysis-id",
parameter_variable_name="coolest_param",
file_id="file-id",
Expand Down
12 changes: 6 additions & 6 deletions robot-server/tests/protocols/test_completed_analysis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from robot_server.protocols.rtp_resources import (
PrimitiveParameterResource,
CsvParameterResource,
CSVParameterResource,
)


Expand Down Expand Up @@ -306,12 +306,12 @@ async def test_store_and_get_csv_rtps_by_analysis_id(
protocol_id="protocol-id",
)
csv_rtp_resources = [
CsvParameterResource(
CSVParameterResource(
analysis_id="analysis-id",
parameter_variable_name="baz",
file_id="file-id",
),
CsvParameterResource(
CSVParameterResource(
analysis_id="analysis-id",
parameter_variable_name="bar",
file_id=None,
Expand Down Expand Up @@ -483,12 +483,12 @@ async def test_make_room_and_add_handles_rtp_tables_correctly(
),
]
existing_csv_rtp_resources = [
CsvParameterResource(
CSVParameterResource(
analysis_id="analysis-id-0",
parameter_variable_name="baz",
file_id="file-id",
),
CsvParameterResource(
CSVParameterResource(
analysis_id="analysis-id-1",
parameter_variable_name="bar",
file_id=None,
Expand Down Expand Up @@ -524,7 +524,7 @@ async def test_make_room_and_add_handles_rtp_tables_correctly(
)
],
csv_rtp_resources=[
CsvParameterResource(
CSVParameterResource(
analysis_id="new-analysis-id",
parameter_variable_name="bar",
file_id="file-id",
Expand Down

0 comments on commit a252211

Please sign in to comment.