Closed yirugi closed 7 years ago
I'll test on linux system anyway. I'll let you know results.
I've tried to install and run in my linux system, but it also failed.
yirugi@yirugi-ubuntu16:~/workspace/nsga/testmodels+obsdataformat/hydrology/TxtInOut$ python ExampleTest.py
Traceback (most recent call last):
File "ExampleTest.py", line 10, in <module>
NSGAII=nsga2.nsga2(SWATtxtinoutDirectory)
File "/usr/local/lib/python2.7/dist-packages/nsga2lib-2.2-py2.7.egg/nsga2lib/nsga2.py", line 33, in __init__
shutil.copy2(os.path.join(libpath,"ScriptsForSWATtxt","Extract_rch.py"), SWATtxtinoutFolderDirectory)
File "/usr/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/nsga2lib-2.2-py2.7.egg/nsga2lib/ScriptsForSWATtxt/Extract_rch.py'
yirugi@yirugi-ubuntu16:~/workspace/nsga/testmodels+obsdataformat/hydrology/TxtInOut$ ls /usr/local/lib/python2.7/dist-packages/nsga2lib-2.2-py2.7.egg/nsga2lib/ScriptsForSWATtxt/
ls: cannot access '/usr/local/lib/python2.7/dist-packages/nsga2lib-2.2-py2.7.egg/nsga2lib/ScriptsForSWATtxt/': No such file or directory
yirugi@yirugi-ubuntu16:~/workspace/nsga/testmodels+obsdataformat/hydrology/TxtInOut$ ls /usr/local/lib/python2.7/dist-packages/nsga2lib-2.2-py2.7.egg/nsga2lib/
__init__.py nsga2.py nsga2utilities.py SWATutilities.py
__init__.pyc nsga2.pyc nsga2utilities.pyc SWATutilities.pyc
Hi I Luk,
Thanks for taking a look at this! The model I emailed to you is slightly different than this. So, expect I will respond here based on what is on git-hub as we are discussing it here. I will go through your comment bullets.
The 'ExampleTest.py' is an example script and designed to be used as a template for specific needs. The 'ExampleTest.py' uses that path to run SWAT model within 'swatTest' folder. With the current directory setup, it should work fine. You probably had different folder setup.
Linux and Darwin are different in how they work but they both uses Unix. I have not tested the script on Darwin but I believe the change you made is enough with my recent changes that I made on the setup.py. You probably wont get the error you mentioned on your last message as the change addressed that error.
I do not see bullet 3.
This bullet has noting to do with the script on git-hub and should not be discussed here but If you read the email, I had already told that you do not need to install the library.
Thanks! Mehmet
Hi Mehmet,
I found few errors while I'm trying to run test models.
The 'ExampleTest.py' has the hard coded path: SWATtxtinoutDirectory = os.path.join(os.getcwd(), 'swatTest') I think the 'swatTest' should be removed? I removed it and continued test though.
I can't run 'python setup' on our SWATShare linux system without administrator's help. So, I tried to install and run it in my system which is MACOSX. But, when I run it, it failed to choose which script should be chosen. nsga2_mid.cmd or nsga2_mid.sh. In mac system, it should choose .sh script, but it chose .cmd.
Here's output I've got so far.
So, I guess the #36 line of nsga2.py should be modified to this:
Note that 'darwin' also has 'win' string, so I changed the sequence of if statement.
Thanks! I Luk