Skip to content

Commit

Permalink
Issue #22: Updates to import statements to ensure all tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-mizielinski committed Jan 21, 2025
1 parent c7b4105 commit 3151741
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 37 deletions.
4 changes: 2 additions & 2 deletions data_request_api/dev/JA/workflow_example_GRtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import json

from data_request_api.stable.content.dreq_api import dreq_content as dc
from data_request_api.stable.transform.data_request import DataRequest
from data_request_api.stable.transform.logger import change_log_file, change_log_level
from data_request_api.stable.query.data_request import DataRequest
from data_request_api.stable.utilities.logger import change_log_file, change_log_level

# Set up log file (default to stdout) and log level
change_log_file(default=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import re
import warnings

from ...transform.logger import get_logger # noqa
from .mapping_table import version_consistency
from data_request_api.stable.utilities.logger import get_logger # noqa
from data_request_api.stable.content.dreq_api.mapping_table import version_consistency

# UID generation
default_count = 0
Expand Down
4 changes: 2 additions & 2 deletions data_request_api/stable/content/dreq_api/dreq_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from bs4 import BeautifulSoup

from . import consolidate_export as ce
from .mapping_table import mapping_table
from ...transform.logger import get_logger # noqa
from data_request_api.stable.content.dreq_api.mapping_table import mapping_table
from data_request_api.stable.utilities.logger import get_logger # noqa


# Suppress pooch info output
Expand Down
4 changes: 2 additions & 2 deletions data_request_api/stable/content/dump_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import six

from utilities.logger import get_logger, change_log_level, change_log_file
from utilities.tools import read_json_input_file_content, write_json_output_file_content
from data_request_api.stable.utilities.logger import get_logger, change_log_level, change_log_file
from data_request_api.stable.utilities.tools import read_json_input_file_content, write_json_output_file_content


def correct_key_string(input_string, *to_remove_strings):
Expand Down
8 changes: 4 additions & 4 deletions data_request_api/stable/query/data_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import six

from utilities.logger import get_logger, change_log_file, change_log_level
from content.dump_transformation import transform_content
from utilities.tools import read_json_file
from query.vocabulary_server import VocabularyServer, is_link_id_or_value, build_link_from_id
from data_request_api.stable.utilities.logger import get_logger, change_log_file, change_log_level
from data_request_api.stable.content.dump_transformation import transform_content
from data_request_api.stable.utilities.tools import read_json_file
from data_request_api.stable.query.vocabulary_server import VocabularyServer, is_link_id_or_value, build_link_from_id

version = "0.1"

Expand Down
4 changes: 2 additions & 2 deletions data_request_api/stable/query/vocabulary_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import six

from utilities.logger import get_logger
from utilities.tools import read_json_file
from data_request_api.stable.utilities.logger import get_logger
from data_request_api.stable.utilities.tools import read_json_file


def is_link_id_or_value(elt):
Expand Down
2 changes: 1 addition & 1 deletion data_request_api/stable/utilities/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
import os

from utilities.logger import get_logger
from data_request_api.stable.utilities.logger import get_logger


def read_json_file(filename):
Expand Down
6 changes: 3 additions & 3 deletions scripts/database_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import sys

import data_request_api.stable.content.dreq_api.dreq_content as dc
from data_request_api.stable.transform.dump_transformation import transform_content
from data_request_api.stable.transform.tools import write_json_output_file_content
from data_request_api.stable.transform.logger import change_log_file, change_log_level
from data_request_api.stable.content.dump_transformation import transform_content
from data_request_api.stable.utilities.tools import write_json_output_file_content
from data_request_api.stable.utilities.logger import change_log_file, change_log_level


# Set up log file (default to stdout) and log level
Expand Down
4 changes: 2 additions & 2 deletions scripts/workflow_example_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import six

from data_request_api.stable.content import dreq_content as dc
from data_request_api.stable.transform.data_request import DataRequest
from data_request_api.stable.transform.logger import change_log_file, change_log_level
from data_request_api.stable.query.data_request import DataRequest
from data_request_api.stable.utilities.logger import change_log_file, change_log_level


# Set up log file (default to stdout) and log level
Expand Down
6 changes: 3 additions & 3 deletions tests/test_data_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import os
import unittest

from data_request_api.stable.transform.tools import read_json_input_file_content, write_json_output_file_content
from data_request_api.stable.utilities.tools import read_json_input_file_content, write_json_output_file_content

from data_request_api.stable.transform.data_request import DRObjects, Theme, ExperimentsGroup, VariablesGroup, Opportunity, DataRequest, version
from data_request_api.stable.transform.vocabulary_server import VocabularyServer, is_link_id_or_value
from data_request_api.stable.query.data_request import DRObjects, ExperimentsGroup, VariablesGroup, Opportunity, DataRequest, version
from data_request_api.stable.query.vocabulary_server import VocabularyServer, is_link_id_or_value


class TestDRObjects(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dump_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import copy
import unittest

from data_request_api.stable.transform.tools import read_json_file, write_json_output_file_content
from data_request_api.stable.transform.dump_transformation import correct_key_string, correct_dictionaries, transform_content_one_base,\
from data_request_api.stable.utilities.tools import read_json_file, write_json_output_file_content
from data_request_api.stable.content.dump_transformation import correct_key_string, correct_dictionaries, transform_content_one_base,\
transform_content_three_bases, transform_content, split_content_one_base


Expand Down
9 changes: 2 additions & 7 deletions tests/test_vocabulary_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@

import copy
import unittest
import sys


sys.path.append('../data_request_api/stable')


from utilities.tools import read_json_input_file_content
from query.vocabulary_server import VocabularyServer, is_link_id_or_value, build_link_from_id
from data_request_api.stable.utilities.tools import read_json_input_file_content
from data_request_api.stable.query.vocabulary_server import VocabularyServer, is_link_id_or_value, build_link_from_id


class TestLinks(unittest.TestCase):
Expand Down
7 changes: 2 additions & 5 deletions tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
import unittest
import tempfile

sys.path.append('../data_request_api/stable')
sys.path.append("../data_request_api/stable/content/dreq_api")


import dreq_content as dc
from query.data_request import DataRequest
import data_request_api.stable.content.dreq_api.dreq_content as dc
from data_request_api.stable.query.data_request import DataRequest


class TestWorkflow1(unittest.TestCase):
Expand Down

0 comments on commit 3151741

Please sign in to comment.