diegoabt / img2net Goto Github PK
View Code? Open in Web Editor NEWPython implementation of the img2net algorithm.
Python implementation of the img2net algorithm.
Hi, I was trying to run the test file, and I found a couple of issues. First, when running the test python test_img2net.py
I get the following output:
carlose@GLaDOS:~/GitProjects/Img2net/code/test$ python test_img2net.py
Traceback (most recent call last):
File "test_img2net.py", line 6, in <module>
import img2net
File "/home/carlose/GitProjects/Img2net/code/test/../img2net-core/img2net.py", line 10, in <module>
import filtering
File "/home/carlose/GitProjects/Img2net/code/test/../img2net-core/filtering.py", line 14, in <module>
with open("/Users/dtheuerkauf/Nextrout/nextrout_location.txt") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/dtheuerkauf/Nextrout/nextrout_location.txt'
After changing it to point to where I cloned Nextrout (in the same directory as Img2net) I stop getting that error, but I get another one:
carlose@GLaDOS:~/GitProjects/Img2net/code/test$ python test_img2net.py
root /home/carlose/GitProjects/Nextrout
Global repo non found
Traceback (most recent call last):
File "test_img2net.py", line 6, in <module>
import img2net
File "/home/carlose/GitProjects/Img2net/code/test/../img2net-core/img2net.py", line 10, in <module>
import filtering
File "/home/carlose/GitProjects/Img2net/code/test/../img2net-core/filtering.py", line 28, in <module>
import meshtools as mt
ModuleNotFoundError: No module named 'meshtools'
Looking into this, I found that the file "Img2net/code/img2net-core/filtering.py" refers to the dmk utilities cloned when running Nextrout in a directory called "dmk", while Nextrout clones them into the directory "dmk_utilities".
After changing references to ".../dmk/..." to ".../dmk_utilities/...", the example seems to work, but I do get a path printed which I don't think exists in my machine: /home/dtheuerkauf/Nextrout/python_scripts/
, and I also get the following message printed: rm: cannot remove '../../data/output/test/angolan_river_crop/nextrout/': No such file or directory
.
I feel like this is an issue of making a few paths be relative instead of fixed, but I don't know enough python yet to confidently submit a branch with a proposal. Let me know if you need more information on the results of what I ran.
Thanks for your time
Change the following snippet of code inside filtering.py
:
# Now you can use the 'root' variable to construct the path to nextrout_location.txt
nextrout_location_file = os.path.join(root, "nextrout_location.txt")
with open(nextrout_location_file) as f:
lines = f.readlines()
# Import I/O for timedata
try:
sys.path.append(root + "/../dmk/globals/python/timedata/")
import timedata as td
except:
print("Global repo non found")
# Import geometry tools
sys.path.append(root + "/../dmk/geometry/python/")
import meshtools as mt
sys.path.append(root + "/../dmk/dmk_solver/otp_solver/preprocess/assembly/")
import example_grid
# Import dmk tools
sys.path.append(root + "/../dmk/dmk_solver/otp_solver/python/")
import dmk_p1p0
sys.path.append(
root + "/../dmk/dmk_solver/build/python/fortran_python_interface/"
)
There's a problem with meshtools
needed from Nextrout
, together with the Global dir needed from Gitlab dmk
source code:
Global repo non found
Traceback (most recent call last):
File "test_img2net.py", line 6, in <module>
import img2net
File "/home/dtheuerkauf/Contributions/Img2net/code/test/../img2net-core/img2net.py", line 10, in <module>
import filtering
File "/home/dtheuerkauf/Contributions/Img2net/code/test/../img2net-core/filtering.py", line 32, in <module>
import meshtools as mt
ModuleNotFoundError: No module named 'meshtools'
What to do about it? Improved the way the requirements from Nextrout
are presented, so it is more easily installable.
Once the tutorial is ready, add it to colab.
Not sure about the gitlab external dependencies, and whether they still work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.