Exemple #1
0
import pickle
from pyflight.results import Result
from results_printer import print_results

with open("results.pckl", "rb") as file:
    answer = pickle.load(file)

assert isinstance(answer, Result)

print_results(answer)
# Create a glazing system using the NFRC U environment in order to get NFRC U results
# U and SHGC can be caculated for any given environment but in order to get results
# The NFRC U and SHGC environments are provided as already constructed environments and Glazing_System
# defaults to using the NFRC U environments

glazing_system_u_environment = pywincalc.GlazingSystem(
    optical_standard=optical_standard,
    solid_layers=[slim_white_pella_venetian_blind, generic_clear_3mm_glass],
    gap_layers=[gap_1],
    width_meters=glazing_system_width,
    height_meters=glazing_system_height,
    environment=pywincalc.nfrc_u_environments(),
    bsdf_hemisphere=bsdf_hemisphere)

glazing_system_shgc_environment = pywincalc.GlazingSystem(
    optical_standard=optical_standard,
    solid_layers=[slim_white_pella_venetian_blind, generic_clear_3mm_glass],
    gap_layers=[gap_1],
    width_meters=glazing_system_width,
    height_meters=glazing_system_height,
    environment=pywincalc.nfrc_shgc_environments(),
    bsdf_hemisphere=bsdf_hemisphere)

results_name = "Results for a double-layer system with exterior Venetian blind downloaded from the IGSDB"
print("*" * len(results_name))
print(results_name)
print("*" * len(results_name))
results_printer.print_results(glazing_system_u_environment,
                              glazing_system_shgc_environment)
Exemple #3
0
# preparing request to QPX
my_trip = pyflight.Request()

# adding slices/routes to trip
my_trip.add_slice(stage1)
my_trip.add_slice(stage2)

# adding details
my_trip.adult_count = 2
my_trip.children_count = 0

# sale country - prices in currency of this country
my_trip.sale_country = "PL"

# number of returned solutions
my_trip.solution_count = 10

# send request to QPX
print("Sending request...")
solutions = my_trip.send_sync()

print("Dumping data")
with open("results_3.pckl", "wb") as file:
    pickle.dump(solutions, file)

print("Done.")

# print formatted output
print_results(solutions)