"import mdig" to the start of the update method fixes it!
I'm committed and pushed the change so you can just use "bzr pull"
weird!
Joel Pitt, PhD | http://ferrouswheel.me | +64 21 101 7308
NetEmpathy Co-founder | http://netempathy.com
OpenCog Developer | http://opencog.org
Board member, Humanity+ | http://humanityplus.org
Try bzr pulling again...
Sorry about this, I've been cleaning up the code and although I'm
slowly adding automated testing, it doesn't catch everything yet.
Joel Pitt, PhD | http://ferrouswheel.me | +64 21 101 7308
NetEmpathy Co-founder | http://netempathy.com
OpenCog Developer | http://opencog.org
Board member, Humanity+ | http://humanityplus.org
Are you running this from within GRASS?
I've been running things from outside of GRASS and explicitly setting
the following two options
GISDBASE = ""
LOCATION_NAME = ""
You'll need to replace these with the actual GRASS DB directory and
the LOCATION_NAME to begin in)
MDiG can detect models in other GIS locations within the same
GISDBASE, but it needs at least one LOCATION to begin working with
GRASS commands. You should also check some of the other variables like
GISBASE to ensure it's a real directory.
I'll try to fix things so that it reads all this from the GRASS
environment when running MDiG from inside GRASS.
Cheers
Joel Pitt, PhD | http://ferrouswheel.me | +64 21 101 7308
NetEmpathy Co-founder | http://netempathy.com
OpenCog Developer | http://opencog.org
Board member, Humanity+ | http://humanityplus.org
Those variables should be set in mdig.conf, not on the command line! ;-)
Sorry about this, it's another change necessary for the integration
with the GRASS DB.
Basically you just have to add an element
<GISLocation>location_name</GISLocation>
After the <random> element, but before the <regions> element.
The location_name has to already exist in the GISDBASE however.
-
You don't need to change the mdig.conf as it will automatically change
the location/mapset for each model. The reason those details are in
the mdig.conf is that MDiG needs to initialise GRASS on *some
location* otherwise it'll get confused.
Cheers,
Joel Pitt, PhD | http://ferrouswheel.me | +64 21 101 7308
NetEmpathy Co-founder | http://netempathy.com
OpenCog Developer | http://opencog.org
Board member, Humanity+ | http://humanityplus.org
First question, are you using the latest version from bzr? (just need
to check it's not something I've already fixed...)
If you are, then proceed with the below...
Is this inside or outside of GRASS?
For error 1, can you add the line:
print self.grass_vars
just before
raise GRASSCommandException(commandstring,self.stderr,ret)
in GRASSInterface.py?
Then try it again and let me know the output just before the error.
Hopefully this will indicate what part of the GRASS setup is broken. I
assume that going into the grass location manually (with GRASS) and
running g.mapset works fine?
Apologies for these hassles once again - I've been slowly building the
testing framework up to ensure things work correctly, but there's ALOT
of code so it's been taking me a while.
J
Yeah - the grass_vars change and MDiG will sometimes move to the
PERMANENT mapset (and others) to do stuff... so that's okay.
Are you able to package your model and supporting files into a zip for
me to test locally?
(Also, I'm assuming you made the location using GRASS and that you've
checked it's made a PERMANENT mapset?)
J
Fixed in latest bzr.
Stupid mistake where I swapped the location and mapset parameters and
obviously didn't test it.
However, now your CODA file seems to be the wrong format... I'll leave
you to double check this before I start checking if it's an MDiG
issue.
I'm not sure I follow that last bit? It should complain when the
mapset already exists as each
model has it's own mapset (as does each instance, but those get
created automatically).
> Cool - then it has added! And (I imagine you planned this) it is able to
> find the index file specified in the transition files in the PERMANENT
> mapset just fine (as it should, but you never know!). I'll try giving it a
> run and see how she goes!
Yup - the idea is that you can store maps either in the PERMANENT
mapset or in the main model mapset (i.e. not the instance mapsets that
created later). There may be some tuning required to get the main
model mapset to be correctly accessable so I'd stick with putting them
in PERMANENT for now.
J