.set_network_file_location(+)

TntpNetworkReaderSettings method

Description

Set the network input file location to be used by the TntpZoningReader. This is a mandatory setting the user is expected to set.

Signature

.set_network_file_location(input_file_location: str)

with

Parameter Type Unit Default Description
input_file_location str None N/A The network input file to extract the zone nodes from

Return type

N/A

Example 1

from planit import *

planit_instance = Planit()

# TNTP net reader - prep
tntp_net_reader: TntpNetworkReaderWrapper = planit_instance.converter_factory.create(ConverterType.NETWORK) \
    .create_reader(NetworkReaderType.TNTP)
network_settings: TntpNetworkReaderSettingsWrapper = tntp_net_reader.settings
network_settings.set_network_file(NETWORK_FILE_PATH)
network_settings.set_node_coordinate_file(NODE_COORD_FILE_PATH)
network_settings.set_network_file_columns(create_tntp_network_file_cols())
# ... other settings

converter = planit_instance.converter_factory.create(ConverterType.ZONING)

# TNTP zon reader - prep (pass in net_reader)
tntp_zon_reader: TntpZoningReaderWrapper = converter.create(ConverterType.ZONING) \
    .create_reader(ZoningReaderType.TNTP, tntp_net_reader)
zoning_settings = tntp_zon_reader.settings
zoning_settings.set_network_file_location(NETWORK_FILE_PATH)

#PLANit zoning writer
planit_writer = converter.create_writer(ZoningWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")

# perform conversion
converter.convert(tntp_reader, planit_writer)

See also

N/A

Source code

Class TntpZoningReaderSettingsWrapper in converterwrappers.py