# Path: route_model/config/network_config.py
# class NetworkConfig(UserDict):
# 	"""store network configuration data"""
# 	
# 	def __init__(self, changes={}):
# 		UserDict.__init__(self)
# 		self['data_dir']=r"X:\Projects\BikeModel\data\route_model\input\network\test"
# 		self['link_file']=os.path.join(self['data_dir'],'links.csv')
# 		self['node_file']=os.path.join(self['data_dir'],'nodes.csv')
# 		self['dist_var']='DISTANCE'
# 		self['dist_scl']=1 #rescales with node distance x dist_scl= link distance
# 		self['max_centroid']=None
# 
# 		for key in changes:
# 			self[key]=changes[key]


from networkx.classes.digraph import DiGraph
from math import sqrt, acos, pi
from numpy import *
from route_model.config.network_config import NetworkConfig
import os, csv
import unittest
		for e2 in G.edges([e1[1]],data=True):
			dual_data=e2[2]
			dual_data['TURN']=0
			dual_data['L_TURN']=0
			dual_data['R_TURN']=0
			dual_data['U_TURN']=0
			the_turn=G.turn_dir(e1,e2)
			if the_turn:
				dual_data['TURN']=1
				if the_turn=='L':
					dual_data['L_TURN']=1
				if the_turn=='R':
					dual_data['R_TURN']=1
				if the_turn=='U':
					dual_data['U_TURN']=1
			H.add_edge((e1[0],e1[1]),(e2[0],e2[1]),attr_dict=dual_data)
			
			
	H.orig_network=G.copy()
						
	return H

class TransportNetworkError(Exception):
	pass
	

class Tests(unittest.TestCase):
	
	def setUp(self):
		

# Path: route_model/config/network_config.py
# class NetworkConfig(UserDict):
# 	"""store network configuration data"""
# 	
# 	def __init__(self, changes={}):
# 		UserDict.__init__(self)
# 		self['data_dir']=r"X:\Projects\BikeModel\data\route_model\input\network\test"
# 		self['link_file']=os.path.join(self['data_dir'],'links.csv')
# 		self['node_file']=os.path.join(self['data_dir'],'nodes.csv')
# 		self['dist_var']='DISTANCE'
# 		self['dist_scl']=1 #rescales with node distance x dist_scl= link distance
# 		self['max_centroid']=None
# 
# 		for key in changes:
# 			self[key]=changes[key]


# Path: route_model/transport_network.py
from networkx.classes.digraph import DiGraph
from math import sqrt, acos, pi
from numpy import *
from route_model.config.network_config import NetworkConfig
import os, csv
import unittest

		for e2 in G.edges([e1[1]],data=True):
			dual_data=e2[2]
			dual_data['TURN']=0
			dual_data['L_TURN']=0
			dual_data['R_TURN']=0
			dual_data['U_TURN']=0
			the_turn=G.turn_dir(e1,e2)
			if the_turn:
				dual_data['TURN']=1
				if the_turn=='L':
					dual_data['L_TURN']=1
				if the_turn=='R':
					dual_data['R_TURN']=1
				if the_turn=='U':
					dual_data['U_TURN']=1
			H.add_edge((e1[0],e1[1]),(e2[0],e2[1]),attr_dict=dual_data)
			
			
	H.orig_network=G.copy()
						
	return H

class TransportNetworkError(Exception):
	pass
	

class Tests(unittest.TestCase):
	
	def setUp(self):
		

		network_config=NetworkConfig()