Пример #1
0
# Modules:
from collections import OrderedDict
import os
import xmltodict

# RiBuild Modules:
from delphin_6_automation.database_interactions.auth import dtu_byg
from delphin_6_automation.delphin_setup import delphin_permutations
from delphin_6_automation.file_parsing import delphin_parser
from delphin_6_automation.database_interactions import mongo_setup
import delphin_6_automation.pytest.pytest_helper_functions as helper

# -------------------------------------------------------------------------------------------------------------------- #
# TEST

mongo_setup.global_init(dtu_byg)


def test_get_layers_1():
    source_path = os.path.dirname(os.path.realpath(__file__)) + '/test_files'
    delphin_dict = delphin_parser.dp6_to_dict(source_path +
                                              '/delphin_project.d6p')
    delphin_layers = delphin_permutations.get_layers(delphin_dict)

    correct_layer_dict = {
        0: {
            'material': 'Lime Cement Plaster light [630]',
            'x_width': 0.009999999999999998,
            'x_index': (0, 6)
        },
        1: {
Пример #2
0
from delphin_6_automation.database_interactions.auth import auth_2d_1d as auth_dict
from delphin_6_automation.database_interactions import general_interactions

# -------------------------------------------------------------------------------------------------------------------- #
# RIBuild

print("---> in download script")

user = getpass.getuser()

folder = r'D:\WP6_1d2d_simulated'

if not os.path.exists(folder):
    pathlib.Path(folder).mkdir(parents=True)

server = mongo_setup.global_init(auth_dict)
#simulated_projects = delphin_entry.Delphin.objects(simulated__exists=True)

#pd.Series(simulated_projects).to_csv('C:\\Users\\sbj\\Documents\\WP6 Study 2D_1D\\simulated.txt')

print(
    f'There are currently {delphin_entry.Delphin.objects(simulated__exists=True).count()} simulated projects in the database'
)
print(f'Downloading Projects')

#range_start = int(pd.read_csv('range.txt').columns[1])
#print('Current start: ', range_start)
# fejl ...8c71 og 8c79 og 8caf og 8d08
#range_start = 0

for project in delphin_entry.Delphin.objects(
Пример #3
0
def config_mongo():
    mongo_setup.global_init(dtu_byg)
Пример #4
0
from delphin_6_automation.database_interactions import general_interactions
from delphin_6_automation.database_interactions import mongo_setup
from delphin_6_automation.database_interactions.auth import auth_dict
from delphin_6_automation.database_interactions import delphin_interactions
from delphin_6_automation.database_interactions.db_templates import delphin_entry
import os
import pandas as pd

mongo_setup.global_init(auth_dict)

folder = r'U:\RIBuild\2D_1D\Results'
simulated_id_folder = r'U:\RIBuild\2D_1D\Delphin Project\4A'


def download(sim_obj):
    result_id = str(sim_obj.results_raw.id)
    general_interactions.download_raw_result(result_id, folder)
    delphin_interactions.download_delphin_entry(sim_obj,
                                                folder + f'/{result_id}')


excel_frame = pd.DataFrame(columns=[
    'Simulation ID', 'Result ID', 'Dimension', 'Brick Type', 'Plaster Type',
    'Insulation Type', 'Acronym'
])
bricks1d = [
    'AltbauziegelDresdenZP', 'AltbauziegelDresdenZD',
    'AltbauziegelRoteKasernePotsdamInnenziegel1', 'LimePlasterHist'
]
bricks2d = [
    'AltbauziegelDresdenZP', 'AltbauziegelDresdenZD',