pyNetwork.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Parallel.GAMIT 作者: demiangomez 项目源码 文件源码
def __init__(self, cnn, NetworkConfig, year, doys):

        try:
            self.Name = NetworkConfig['network_id'].lower()

            self.Core = NetClass(cnn, self.Name, NetworkConfig['stn_core'], year, doys)

            self.Secondary = NetClass(cnn, self.Name + '.Secondary', NetworkConfig['stn_list'], year, doys, self.Core.StrStns)

            # create a StationAlias if needed, if not, just assign StationCode
            self.AllStations = []
            for Station in self.Core.Stations + self.Secondary.Stations:
                self.CheckStationCodes(Station)
                if [Station.NetworkCode, Station.StationCode] not in [[stn['NetworkCode'], stn['StationCode']] for stn in self.AllStations]:
                    self.AllStations.append({'NetworkCode': Station.NetworkCode, 'StationCode': Station.StationCode, 'StationAlias': Station.StationAlias})

            self.total_stations = len(self.Core.Stations) + len(self.Secondary.Stations)

            sys.stdout.write('\n >> Total number of stations: %i (including core)\n\n' % (self.total_stations))

        except:
            raise

        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号