In-Development TradeDangerous: power-user trade optimizer

Someone must've asked this before, but I'm too tired to go through any more walls of text.. but was there a way to specify the pad size with trade.py run? My Lakon 7 doesn't quite fit on the outposts.
 
Someone must've asked this before, but I'm too tired to go through any more walls of text.. but was there a way to specify the pad size with trade.py run? My Lakon 7 doesn't quite fit on the outposts.

Looking at current cmd_run.py no switch yet for pad size
 
Not sure if this thread is correct for errors. When I try trade.py update, I am getting a ImportError: DLL load failed: %1 is not a valid Win32 application.
I am running Win 7 64 bit until the OS X client is released.
 
Not sure if this thread is correct for errors. When I try trade.py update, I am getting a ImportError: DLL load failed: %1 is not a valid Win32 application.
I am running Win 7 64 bit until the OS X client is released.

Can you please paste the entire output? (From command prompt, press alt+space, select edit -> mark, you can now click&draw a selection box over the text in the window, hit enter when you've highlighted the appropriate text, and then paste it into the forum box here)

- - - - - Additional Content Posted / Auto Merge - - - - -

Someone must've asked this before, but I'm too tired to go through any more walls of text.. but was there a way to specify the pad size with trade.py run? My Lakon 7 doesn't quite fit on the outposts.

FISHU!

Not yet. Soon(TM). Like, literally the next day or two.

- - - - - Additional Content Posted / Auto Merge - - - - -

I've finally added a "station" command for adding, updating and removing stations -- but only for your local db and csv files. You can also use this command to *query* some useful info about a given station (such as best trades, etc).

I've described it in the README and also in the wiki "cookbook".

Here's the catch: At the moment TD treats the ".csv" files as absolute and definitive. So if you add local stations and then download the station.csv from somewhere else, you'll lose your local changes.

If you're using the .csv files that came with TD you can contribute your changes to the project via this issue-tracking ticket

Or if you're a git-smart user, you may want to "fork" the TD repository and then you can commit your local .csv file and generate a "push" request. If you're not a git-smart user, forget that idea, right now. Forget the hell out of it.

If you're using maddavo, no problem, you can always upload your station.csv to him after changing it, but there is currently no way to upload a "delete".
 
Can you please paste the entire output? (From command prompt, press alt+space, select edit -> mark, you can now click&draw a selection box over the text in the window, hit enter when you've highlighted the appropriate text, and then paste it into the forum box here)

- - - - - Additional Content Posted / Auto Merge - - - - -
$ /c/trade/trade.py update -GF -wx=-40 -wy=40 ERAVATE/Maine
NOTE:
. Press CTRL-C here to abort edit, otherwise just close the update window to s
e.
. '-F' makes the window show in-front of the E:D Window.
. '-A' forces all items to be listed.


Traceback (most recent call last):
File "c:/trade/trade.py", line 76, in <module>
main(sys.argv)
File "c:/trade/trade.py", line 50, in main
results = cmdenv.run(tdb)
File "c:\trade\commands\commandenv.py", line 78, in run
return self._cmd.run(results, self, tdb)
File "c:\trade\commands\update_cmd.py", line 401, in run
guidedUpdate(tdb, cmdenv)
File "c:\trade\commands\update_cmd.py", line 352, in guidedUpdate
from commands.update_gui import render
File "c:\trade\commands\update_gui.py", line 1, in <module>
import tkinter as tk
File "c:\Python34\lib\tkinter\__init__.py", line 36, in <module>
from tkinter import _fix
File "c:\Python34\lib\tkinter\_fix.py", line 65, in <module>
import _tkinter
ImportError: DLL load failed: %1 is not a valid Win32 application.
 
File "c:\trade\commands\update_gui.py", line 1, in <module>
import tkinter as tk
File "c:\Python34\lib\tkinter\__init__.py", line 36, in <module>
from tkinter import _fix
File "c:\Python34\lib\tkinter\_fix.py", line 65, in <module>
import _tkinter
ImportError: DLL load failed: %1 is not a valid Win32 application.

This is saying there's something wrong with your Python installation, or that you have installed both the 32- and 64- bit versions of Python.

The advice for fixing this generally appears to be to uninstall and reinstall python: http://stackoverflow.com/questions/8724729/python-tkinter-on-windows

You can replicate this problem by pressing the Windows key or clicking Start and typing "Idle" to open to the Idle GUI. Then at the python '>>>' prompt type:

Code:
>>> import tkinter

and you'll see the error.
 
Thank you, I did do a install of 3.4.2 overtop of 3.4.1. I will uninstall and reinstall Python 3.4.2 and report back my tomorrow. Otherwise great tool. So far as I have used it everything else works.
 
If you're using maddavo, no problem, you can always upload your station.csv to him after changing it, but there is currently no way to upload a "delete".

If you upload a station to maddavo with a distance of -1 then it will delete the station.
 
If you upload a station to maddavo with a distance of -1 then it will delete the station.

Interesting, will see if I can figure a way to make use of that.

Meanwhile, it looks like someone has entered crap for Abraham Lincoln:

Code:
@ SOL/Abraham Lincoln
   + Chemicals
      Explosives                    1       2          ?         ?
      Hydrogen Fuel               107     113          ?   947537M

(I've submitted a delete for the explosives line)
 
Last edited:
Downloaded the latest from bitbucket, ran maddavo updates and then
Code:
trade.py run --cr 10000000 --cap 532 --ly 12.02 -vvv

Traceback (most recent call last):
  File "trade.py", line 76, in <module>
    main(sys.argv)
  File "trade.py", line 50, in main
    results = cmdenv.run(tdb)
  File "/kfsone-tradedangerous-12a7b15945cb/commands/commandenv.py", line 78, in run
    return self._cmd.run(results, self, tdb)
  File "/kfsone-tradedangerous-12a7b15945cb/commands/run_cmd.py", line 558, in run
    newRoutes = calc.getBestHops(routes, restrictTo=restrictTo)
  File "/kfsone-tradedangerous-12a7b15945cb/tradecalc.py", line 467, in getBestHops
    tdb.loadStationTrades(stationsNotYetLoaded)
  File "/kfsone-tradedangerous-12a7b15945cb/tradedb.py", line 1354, in loadStationTrades
    ) in self.cur:
sqlite3.DatabaseError: database disk image is malformed
Any ideas?

Also:
Code:
trade.py run --cr 10000000 --cap 532 --ly 12.02 -vvv --fr sol
Segmentation fault (core dumped)
 
Last edited:
When i try to do a run of anything fairly large, i get a memoryerror.
Just yesterday, when of 64 hops 3 jumps, it finished damn quick. Now it takes a lot longer, and then results in an error. Even 10 hops and 3 jumps errors out.
Is this something in my system, or has something changed recently?
Example below (in powershell, but cmd does basically the same):
Code:
Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> cd C:\TradeDangerous
PS C:\TradeDangerous> .\trade.py run --insurance 20000 --ly 15.25 --empty-ly 23.55 --cap 18 --credit
s 315990 --hops 10 --from "eravate/ackerman market" --to "eravate" --jumps 2
Traceback (most recent call last):
  File "C:\TradeDangerous\trade.py", line 76, in <module>
  File "C:\TradeDangerous\trade.py", line 50, in main
  File "C:\TradeDangerous\commands\commandenv.py", line 78, in run
  File "C:\TradeDangerous\commands\run_cmd.py", line 558, in run
  File "C:\TradeDangerous\tradecalc.py", line 467, in getBestHops
  File "C:\TradeDangerous\tradedb.py", line 1370, in loadStationTrades
  File "<string>", line 14, in __new__
MemoryError
PS C:\TradeDangerous>
 
The "out of memory" error is being caused by the radical increase in prices getting ahead of development; I'm working towards a fix at the moment.

It should only be happening under 32-bit Python.
 
Last edited:
Ok - for any brave souls who are familiar with using git, I've created a branch, "trade-loading-refactor", to address the memory error and some performance issues. It doesn't currently load data-ages, I'll fix that tomorrow once the core functionality is tested.

If you know how to pull branches with git (it's fairly easy with sourcetree) and you don't mind some hiccups, please give it a try and post either group or here in the thread and let me know if it worked for you (over at least an hour's usage with the 'run' command and otheres) or if you ran into problems.

I found it to be about 90x faster at calculating a wild 8 hop route.
 
I ran the trade-loading-refactor branch a few times now and found that all ages are given as "<1hr" on "run -vvv" while they are fine on "local -v"

I assume that this is what you meant with "It doesn't currently load data-ages" and thus expected behaviour.

EDIT: I really like the info line counting the hops during run... The speedup is fantastic as well!
 
Last edited:
Is it possible to search by commodity.

For example, if picking up a mission from the Knights who say, "Ni!" is it possible to locate the nearest/cheapest purveyor of shrubberies?
 
The "out of memory" error is being caused by the radical increase in prices getting ahead of development; I'm working towards a fix at the moment.

It should only be happening under 32-bit Python.

That matches my experience (I figured it was a 32-bit issue). In 64-bit, I've managed to use a good 8GB when really casting the net.
 
Is it possible to search by commodity.

Like that?
Code:
$ trade.py buy -vv --near gilleke uraninite
Station                            Cost      Stock DistLy Age/days      StnLs Pad
---------------------------------------------------------------------------------
NUENETS/Forrester Dock              785    262.467  12.50     2.05      11.3K Med
NUENETS/Shriver Hub                 785     84.984  12.50     2.10      11.4K Lrg
NUENETS/Harbaugh Port               785     20.656  12.50     2.06      11.3K Med
NUENETS/Laliberte Enterprise        786     14.782  12.50     2.07      11.4K Lrg
-- Average                          821
 
Getting error :
C:\Temp\Trade_Dangerous\trade.py: import.prices:75715 ERROR Unrecognized line/syntax,
got: 'Bauxite 46 56 ?600178130H 2015-01-06 10:01:29'.

when updating prices with trade.py import -i http://kfs.org/td/prices and trade.py import --plug=maddavo
 
I've had this as well. Simply remove the erroneous line with a text editor (notepad++ is very good and will allow you easily find the line number) and then do

trade.py import import.prices

to get the rest of the data in.
 
Back
Top Bottom