Skip to content

Commit

Permalink
Remove DataSource, move files up from parsers directory
Browse files Browse the repository at this point in the history
  • Loading branch information
the-other-james committed Sep 21, 2023
1 parent 2be243f commit 642da08
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pandas as pd

from .on_air_data_source import OnAirDataSource
from ...src.util.print_io import *
from ..src.util.print_io import *
from .parser_util import *

class CSV(OnAirDataSource):
Expand Down
43 changes: 0 additions & 43 deletions onair/data_handling/data_source.py

This file was deleted.

File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion onair/src/run_scripts/execution_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def parse_configs(self, config_filepath):
pass

def parse_data(self, parser_name, parser_file_name, data_file_name, metadata_file_name, subsystems_breakdown=False):
parser = importlib.import_module('onair.data_handling.parsers.' + parser_file_name)
parser = importlib.import_module('onair.data_handling.' + parser_file_name)
parser_class = getattr(parser, parser_name) # This could be simplified if the parsers all extend a parser class... but this works for now
# TODO: This will be changed on an OnAIR Data Source
data_parser = parser_class(data_file_name, metadata_file_name, subsystems_breakdown)
Expand Down
6 changes: 3 additions & 3 deletions onair/src/run_scripts/sbn_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# See "NOSA GSC-19165-1 OnAIR.pdf"

"""
AdapterDataSource class
SBN_Adapter class
Receives messages from SBN, serves as a data source for sim.py
"""
Expand All @@ -18,7 +18,7 @@
import datetime
import os

from ...data_handling.data_source import DataSource
from ...data_handling.on_air_data_source import OnAirDataSource
from ctypes import *
import sbn_client as sbn
import message_headers as msg_hdr
Expand Down Expand Up @@ -75,7 +75,7 @@ def get_current_data(recv_msg, data_struct, app_name):
AdapterDataSource.new_data = True


class AdapterDataSource(DataSource):
class AdapterDataSource(OnAirDataSource):
# Data structure
# TODO: Make init data structure better
currentData = []
Expand Down
1 change: 0 additions & 1 deletion onair/src/run_scripts/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from ..util.file_io import *
from ..util.print_io import *
from ..util.sim_io import *
from ...data_handling.data_source import DataSource

MAX_STEPS = 2050
DIAGNOSIS_INTERVAL = 100
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import pytest
from mock import MagicMock

import onair.data_handling.parsers.csv_parser as csv_parser
from onair.data_handling.parsers.csv_parser import CSV
import onair.data_handling.csv_parser as csv_parser
from onair.data_handling.csv_parser import CSV

@pytest.fixture
def setup_teardown():
Expand Down
264 changes: 0 additions & 264 deletions test/onair/data_handling/test_data_source.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import pytest
from mock import MagicMock

import onair.data_handling.parsers.on_air_data_source as on_air_data_source
from onair.data_handling.parsers.on_air_data_source import OnAirDataSource
import onair.data_handling.on_air_data_source as on_air_data_source
from onair.data_handling.on_air_data_source import OnAirDataSource


class FakeOnAirDataSource(OnAirDataSource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
from mock import MagicMock

import onair.data_handling.parsers.parser_util as parser_util
import onair.data_handling.parser_util as parser_util

# extract_meta_data tests
def test_parser_util_extract_meta_data_raises_error_when_given_blank_meta_data_file():
Expand Down
Loading

0 comments on commit 642da08

Please sign in to comment.