# Path: urbanaccess/network.py
# class urbanaccess_network(object):
#     """
#     An urbanaccess object of pandas.DataFrames representing
#     the components of a graph network
# 
#     Parameters
#     ----------
#     transit_nodes : pandas.DataFrame
#     transit_edges : pandas.DataFrame
#     net_connector_edges : pandas.DataFrame
#     osm_nodes : pandas.DataFrame
#     osm_edges : pandas.DataFrame
#     net_nodes : pandas.DataFrame
#     net_edges : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  transit_nodes=pd.DataFrame(),
#                  transit_edges=pd.DataFrame(),
#                  net_connector_edges=pd.DataFrame(),
#                  osm_nodes=pd.DataFrame(),
#                  osm_edges=pd.DataFrame(),
#                  net_nodes=pd.DataFrame(),
#                  net_edges=pd.DataFrame()):
#         self.transit_nodes = transit_nodes
#         self.transit_edges = transit_edges
#         self.net_connector_edges = net_connector_edges
#         self.osm_nodes = osm_nodes
#         self.osm_edges = osm_edges
#         self.net_nodes = net_nodes
#         self.net_edges = net_edges
# 
# Path: urbanaccess/gtfs/gtfsfeeds_dataframe.py
# class urbanaccess_gtfs_df(object):
#     """
#     A collection of DataFrames representing the standardized and
#     merged metropolitan-wide transit network from multiple
#     GTFS feeds.
# 
#     Parameters
#     ----------
#     gtfsfeeds_dfs : object
#         processed DataFrames of corresponding GTFS feed text files
#     gtfsfeeds_dfs.stops : pandas.DataFrame
#     gtfsfeeds_dfs.routes : pandas.DataFrame
#     gtfsfeeds_dfs.trips : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times : pandas.DataFrame
#     gtfsfeeds_dfs.calendar : pandas.DataFrame
#     gtfsfeeds_dfs.calendar_dates : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times_int : pandas.DataFrame
#     gtfsfeeds_dfs.headways : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  stops=pd.DataFrame(),
#                  routes=pd.DataFrame(),
#                  trips=pd.DataFrame(),
#                  stop_times=pd.DataFrame(),
#                  calendar=pd.DataFrame(),
#                  calendar_dates=pd.DataFrame(),
#                  stop_times_int=pd.DataFrame(),
#                  headways=pd.DataFrame()):
#         self.stops = stops
#         self.routes = routes
#         self.trips = trips
#         self.stop_times = stop_times
#         self.calendar = calendar
#         self.calendar_dates = calendar_dates
#         self.stop_times_int = stop_times_int
#         self.headways = headways


import pytest
import os
import time
import glob
import pandas as pd
import numpy as np
import urbanaccess.gtfs.network as gtfs_network
import urbanaccess.gtfs.load as gtfs_load
from urbanaccess.network import urbanaccess_network
from urbanaccess.gtfs.gtfsfeeds_dataframe import urbanaccess_gtfs_df
    result_edge = transit_net.transit_edges.copy()
    # test that output df is identical to expected df
    result_edge = result_edge.reindex(
        sorted(result_edge.columns), axis=1)
    expected_result = expected_result.reindex(
        sorted(expected_result.columns), axis=1)
    # ensure 'sequence' is int32 for test as other OS sometimes reads this as
    # int64 and will cause tests to fail when using equals()
    result_edge['sequence'] = result_edge['sequence'].astype('int32')
    expected_result['sequence'] = expected_result['sequence'].astype('int32')
    assert result_edge.equals(expected_result)


def test_create_transit_net_wo_calendar_dates_timeaware(
        gtfs_feed_wo_calendar_dates,
        expected_urbanaccess_network_keys,
        expected_final_transit_edge_from_feed_wo_calendar_dates_timeaware):
    expected_result = \
        expected_final_transit_edge_from_feed_wo_calendar_dates_timeaware.copy()  # noqa
    transit_net = gtfs_network.create_transit_net(
        gtfs_feed_wo_calendar_dates, day='monday',
        timerange=['07:00:00', '10:00:00'],
        calendar_dates_lookup=None,
        overwrite_existing_stop_times_int=False,
        use_existing_stop_times_int=False,
        save_processed_gtfs=False,
        save_dir=None,
        save_filename=None,
        timerange_pad=None,
        time_aware=True)

# Path: urbanaccess/network.py
# class urbanaccess_network(object):
#     """
#     An urbanaccess object of pandas.DataFrames representing
#     the components of a graph network
# 
#     Parameters
#     ----------
#     transit_nodes : pandas.DataFrame
#     transit_edges : pandas.DataFrame
#     net_connector_edges : pandas.DataFrame
#     osm_nodes : pandas.DataFrame
#     osm_edges : pandas.DataFrame
#     net_nodes : pandas.DataFrame
#     net_edges : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  transit_nodes=pd.DataFrame(),
#                  transit_edges=pd.DataFrame(),
#                  net_connector_edges=pd.DataFrame(),
#                  osm_nodes=pd.DataFrame(),
#                  osm_edges=pd.DataFrame(),
#                  net_nodes=pd.DataFrame(),
#                  net_edges=pd.DataFrame()):
#         self.transit_nodes = transit_nodes
#         self.transit_edges = transit_edges
#         self.net_connector_edges = net_connector_edges
#         self.osm_nodes = osm_nodes
#         self.osm_edges = osm_edges
#         self.net_nodes = net_nodes
#         self.net_edges = net_edges
# 
# Path: urbanaccess/gtfs/gtfsfeeds_dataframe.py
# class urbanaccess_gtfs_df(object):
#     """
#     A collection of DataFrames representing the standardized and
#     merged metropolitan-wide transit network from multiple
#     GTFS feeds.
# 
#     Parameters
#     ----------
#     gtfsfeeds_dfs : object
#         processed DataFrames of corresponding GTFS feed text files
#     gtfsfeeds_dfs.stops : pandas.DataFrame
#     gtfsfeeds_dfs.routes : pandas.DataFrame
#     gtfsfeeds_dfs.trips : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times : pandas.DataFrame
#     gtfsfeeds_dfs.calendar : pandas.DataFrame
#     gtfsfeeds_dfs.calendar_dates : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times_int : pandas.DataFrame
#     gtfsfeeds_dfs.headways : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  stops=pd.DataFrame(),
#                  routes=pd.DataFrame(),
#                  trips=pd.DataFrame(),
#                  stop_times=pd.DataFrame(),
#                  calendar=pd.DataFrame(),
#                  calendar_dates=pd.DataFrame(),
#                  stop_times_int=pd.DataFrame(),
#                  headways=pd.DataFrame()):
#         self.stops = stops
#         self.routes = routes
#         self.trips = trips
#         self.stop_times = stop_times
#         self.calendar = calendar
#         self.calendar_dates = calendar_dates
#         self.stop_times_int = stop_times_int
#         self.headways = headways


# Path: urbanaccess/tests/test_gtfs_network.py
import pytest
import os
import time
import glob
import pandas as pd
import numpy as np
import urbanaccess.gtfs.network as gtfs_network
import urbanaccess.gtfs.load as gtfs_load
from urbanaccess.network import urbanaccess_network
from urbanaccess.gtfs.gtfsfeeds_dataframe import urbanaccess_gtfs_df

    result_edge = transit_net.transit_edges.copy()
    # test that output df is identical to expected df
    result_edge = result_edge.reindex(
        sorted(result_edge.columns), axis=1)
    expected_result = expected_result.reindex(
        sorted(expected_result.columns), axis=1)
    # ensure 'sequence' is int32 for test as other OS sometimes reads this as
    # int64 and will cause tests to fail when using equals()
    result_edge['sequence'] = result_edge['sequence'].astype('int32')
    expected_result['sequence'] = expected_result['sequence'].astype('int32')
    assert result_edge.equals(expected_result)


def test_create_transit_net_wo_calendar_dates_timeaware(
        gtfs_feed_wo_calendar_dates,
        expected_urbanaccess_network_keys,
        expected_final_transit_edge_from_feed_wo_calendar_dates_timeaware):
    expected_result = \
        expected_final_transit_edge_from_feed_wo_calendar_dates_timeaware.copy()  # noqa
    transit_net = gtfs_network.create_transit_net(
        gtfs_feed_wo_calendar_dates, day='monday',
        timerange=['07:00:00', '10:00:00'],
        calendar_dates_lookup=None,
        overwrite_existing_stop_times_int=False,
        use_existing_stop_times_int=False,
        save_processed_gtfs=False,
        save_dir=None,
        save_filename=None,
        timerange_pad=None,
        time_aware=True)

    assert isinstance(transit_net, urbanaccess_network)