Esempio n. 1
0
	def test_profile_and_improve(self):
		start = time.time()
		inmemoryjson = assets.stations("res/stations.jsonl")
		dicbytes = sys.getsizeof(inmemoryjson)

		print "start deepsize:"
		allbytes = assets.deepsize(inmemoryjson)

		print "Structure size is " + str( dicbytes / 1024 ) + " kB"
		print "Total size is " + str( allbytes /1024 ) + " kB"

		end = time.time()		
		print("loading time: " + str(end - start) )

		self.assertEqual(len(inmemoryjson), 68768)
Esempio n. 2
0
    def dtest_elite_deals_real(self):
        self.elite.markets = assets.markets("listings.csv")
        self.elite.stations = assets.stations("stations.json")
        self.elite.systems = assets.systems("systems_populated.json")

        station = self.elite.findStationLike("Russell Ring")[0]
        marketId = station["id"]

        system = self.elite.system(id=station["system_id"])
        proxies = self.elite.proxies(15, system)

        self.assertEqual(len(proxies), 77)

        deals = self.elite.bestdeals(marketId, proxies, 200)

        self.assertEqual(deals, (596000, [(68, '29', 992, 200),
                                          (1265, '24', 1988, 200)]))
Esempio n. 3
0
 def setUp(self):
     entities.reset()
     entities.markets = assets.markets("test/test-markets.csv")
     entities.systems = assets.systems("test/test-systems.json")
     entities.stations = assets.stations("test/test-stations.json")
     entities.commodities = assets.commodities("res/commodities.json")
Esempio n. 4
0
        if not len(dealsFrom):
            instructions.append((target, 0, 0, 0))

    profits.sort(key=lambda (profit, instructions): profit, reverse=True)
    return profits[0]


if __name__ == "__main__":
    print "Start Elite:Dangerous Mission Optimizer"

    if len(sys.argv) == 1 and sys.argv[1] == "--update":
        assets.update("res/commodities.json", True)
        assets.update("res/stations.json")
        assets.update("res/systems_populated.json")
        assets.update("res/listings.csv")

    if len(sys.argv) == 1 or sys.argv[1] != "--maxi":
        print "Limited Edition"
        entities.systems = assets.unPickle("res/systems-mini-50.pic")
        entities.stations = assets.unPickle("res/stations-mini-50.pic")
        entities.markets = assets.unPickle("res/markets-mini-50.pic")
    else:
        entities.stations = assets.stations("stations.json")
        entities.systems = assets.systems("systems_populated.json")
        entities.markets = assets.markets("listings.csv")

    entities.commodities = assets.commodities("res/commodities.json")

    server().runServer()

    print "End Elite:D-MO"
Esempio n. 5
0
 def dtest_assets_stations_big(self):
     stations = assets.stations("stations.json")
     self.assertEqual(len(stations), 68598)
Esempio n. 6
0
	def slow_test_assets_doPickle(self):
		stations = assets.stations("stations.json")
		assets.doPickle(stations, "stations.pic")