Move data models to new subdirectory
This commit is contained in:
parent
9d6b5cb77b
commit
208511038b
4 changed files with 26 additions and 13 deletions
|
@ -0,0 +1,13 @@
|
||||||
|
# Copyright 2019 Robert Bosch GmbH
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
|
@ -12,18 +12,18 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""Module for data model."""
|
"""Module for ROS data model."""
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
class DataModel():
|
class RosDataModel():
|
||||||
"""
|
"""
|
||||||
Container to model pre-processed data for analysis.
|
Container to model pre-processed ROS data for analysis.
|
||||||
|
|
||||||
Contains data for an analysis to use. This is a middleground between trace events data and the
|
Contains data for an analysis to use. This is a middleground between ROS userspace trace
|
||||||
output data of an analysis. This aims to represent the data in a ROS-aware way.
|
events data and the output data of an analysis. This aims to represent the data in a
|
||||||
It uses pandas DataFrames directly.
|
ROS-aware way. It uses pandas DataFrames directly.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
|
@ -19,7 +19,7 @@ from typing import List
|
||||||
|
|
||||||
from tracetools_read.utils import get_field
|
from tracetools_read.utils import get_field
|
||||||
|
|
||||||
from .data_model import DataModel
|
from .data_model.ros import RosDataModel
|
||||||
from .handler import EventHandler
|
from .handler import EventHandler
|
||||||
from .lttng_models import EventMetadata
|
from .lttng_models import EventMetadata
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@ class Ros2Processor(EventHandler):
|
||||||
}
|
}
|
||||||
super().__init__(handler_map)
|
super().__init__(handler_map)
|
||||||
|
|
||||||
self._data = DataModel()
|
self._data = RosDataModel()
|
||||||
|
|
||||||
# Temporary buffers
|
# Temporary buffers
|
||||||
self._callback_instances = {}
|
self._callback_instances = {}
|
||||||
|
|
||||||
def get_data_model(self) -> DataModel:
|
def get_data_model(self) -> RosDataModel:
|
||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
def _handle_rcl_init(
|
def _handle_rcl_init(
|
||||||
|
|
|
@ -21,17 +21,17 @@ from typing import Union
|
||||||
|
|
||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
|
|
||||||
from .data_model import DataModel
|
from .data_model.ros import RosDataModel
|
||||||
|
|
||||||
|
|
||||||
class DataModelUtil():
|
class RosDataModelUtil():
|
||||||
"""
|
"""
|
||||||
Data model utility class.
|
Data model utility class.
|
||||||
|
|
||||||
Provides functions to get info on a data model.
|
Provides functions to get info on a ROS data model.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, data_model: DataModel) -> None:
|
def __init__(self, data_model: RosDataModel) -> None:
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue