To check things are installed and working correctly you can follow the
instructions in the "TESTING" file.
To actually create a model: at this stage, you have to specify the
details in an xml file and then run:
mdig.py add [xmlfile.xml]
This will add the model to the current repository (which will be shown
at the bottom of the help message if you run "mdig.py help")
The details for the format do the xml file are here:
http://fruitionnz.com/mdig/index.php?title=DispersalML
But it might help to start with one of the examples in the "models" directory.
I also recommend reading the User Guide on the wiki, although it needs
some improvement (feel free to edit bits which are difficult to
understand!). I'm willing to assist with any questions... or if you
run into a bug.
Joel Pitt, PhD | http://ferrouswheel.me | +852 6683 9980
M-Lab AI Project and OpenCog Developer | http://opencog.org
On 20 December 2010 11:51, Ivan Henriquez Rivera <ivan.he...@upr.edu> wrote:
> Hi Joel,
> I am Iván Henríquez, graduate student in applied mathematic at
> University of Puerto Rico. I am working, with some professors and
> students, in a research project: "Modeling and controlling the spread
> of invasive species over heterogeneous landscapes: Melaleuca
> quinquenervia and Mimosa pellita in Puerto Rico".
> We are very interested in using MDiG for our research and for us
> it will be a pleasure to collaborate with MDiG in all we can.
> I have been using GRASS64(on ubuntu) in last months and I have
> gotten some experience. Now I want to learn to use MDiG. I have
> read about it and I have already installed it(compiled it). I think it would
> be easier
> to learn MDiG with some help because it looks a little hard.
> I would like to do some tests but I don't know how to begin.
> I saw some locations in mdig/test/ and some models but I wonder
> if I could try MDiG with that. If you could give me some instructions
> to try MDiG, it would be great. Once I have run an example I feel
> ready to try MDiG with our data about Puerto Rico and begin to play with it.
> Well, thanks for all Joel. I will be happy if we begin to be
> in contact.
> Have a good day, bye!
> --
> Iván Henríquez
>
>
You need to ensure you have a <GISLocation>locationname</GISLocation>
in the model.xml between the "random" tags and the "regions" tag.
Sorry the examples were not updated to reflect this...
Cheers,
Joel Pitt, PhD | http://ferrouswheel.me | +852 6683 9980
M-Lab AI Project and OpenCog Developer | http://opencog.org
On 7 February 2011 14:54, Ivan Henriquez Rivera <ivan.he...@upr.edu> wrote:
> Hello Joel!
> I had not been able to continue working with MDiG because
> I was a little bussy with others things, but now I have returned.
> I made a xml model. Then I run GRASS and I tried to add it to GRASS.
> I got the following message:
>
> ~/mdig/mdig > ./mdig.py add models/model2.xml
> 20110207 02:11:43 [mdig.repos] INFO: Using GRASS DB location
> /home/ivan/grassdata/locations
> Traceback (most recent call last):
> File "./mdig.py", line 249, in <module>
> main(sys.argv[1:])
> File "./mdig.py", line 173, in main
> the_action.do_me(None)
> File "/home/ivan/mdig/mdig/mdig/actions.py", line 616, in do_me
> mdig.repository.add_model(m)
> File "/home/ivan/mdig/mdig/mdig/modelrepository.py", line 48, in add_model
> raise RepositoryException("Model doesn't define GIS Location for
> simulation")
> mdig.modelrepository.RepositoryException: RepositoryException: Model doesn't
> define GIS Location for simulation
>
> I did not take care about parameters of the simulation because I first
> wanted
> to run any model.
> Please take a look to the attached file to see the model.
> Send an email if you need more information about my data in GRASS.
> I have added your skype to chat if is necesary.
> Thanks!
> 2010/12/23 Ivan Henriquez Rivera <ivan.he...@upr.edu>
>>
>> Ok, I am going to try to make a model and run it.
>> I appreciate your help. =)
>> Good night.
>>
>> 2010/12/23 Joel Pitt <jo...@fruitionnz.com>
>>>
>>> Hi Ivan - I don't think these are major issues for using MDiG. They
>>> are likely just issues with the tests being changed when I ported MDiG
>>> to windows and I didn't check they still work on Ubuntu.
>>>
>>> I'll be getting a new Ubuntu desktop at my work in a couple of weeks
>>> so will be able to better test MDiG then. (although I'm no longer
>>> doing spread modelling, I want to keep maintaining MDiG if it's useful
>>> for people).
>>>
>>> So, I suggest trying to construct an xml model based on one of the
>>> existing ones and then add it to a grass location :-)
>>>
>>> Then try running it...
>>>
>>> my skype is "ferrouswheel" is you want to chat... although I'm about
>>> to go sleep just now, so perhaps i can help tomorrow.
>>>
>>>
>>> Good luck!
>>>
>>> Joel Pitt, PhD | http://ferrouswheel.me | +852 6683 9980
>>> M-Lab AI Project and OpenCog Developer | http://opencog.org
>>>
>>>
>>>
>>>
>>>
>>> On 24 December 2010 00:20, Ivan Henriquez Rivera <ivan.he...@upr.edu>
>>> wrote:
>>> > Hi Joel,
>>> > Now it looks better! But there are still errors. Look:
>>> > ~/mdig/mdig$ sudo apt-get install python-mock
>>> > [sudo] password for ivan:
>>> > Leyendo lista de paquetes... Hecho
>>> > Creando árbol de dependencias
>>> > Leyendo la información de estado... Hecho
>>> > Se instalaron de forma automática los siguientes paquetes y ya no son
>>> > necesarios.
>>> > liblapack-dev libblas-dev patchutils libpcre3-dev libglew1.5
>>> > libpcrecpp0
>>> > gfortran-4.4 gfortran dpatch libbz2-dev
>>> > Utilice «apt-get autoremove» para eliminarlos.
>>> > Se instalarán los siguientes paquetes NUEVOS:
>>> > python-mock
>>> > 0 actualizados, 1 se instalarán, 0 para eliminar y 8 no actualizados.
>>> > Necesito descargar 56.8kB de archivos.
>>> > Se utilizarán 360kB de espacio de disco adicional después de esta
>>> > operación.
>>> > Des:1 http://hn.archive.ubuntu.com/ubuntu/ lucid/universe python-mock
>>> > 0.6.0-1 [56.8kB]
>>> > Descargados 56.8kB en 1s (54.2kB/s)
>>> > Seleccionando el paquete python-mock previamente no seleccionado.
>>> > (Leyendo la base de datos ... 00%
>>> > 317967 ficheros y directorios instalados actualmente.)
>>> > Desempaquetando python-mock (de .../python-mock_0.6.0-1_all.deb) ...
>>> > Procesando disparadores para doc-base ...
>>> > Processing 1 added doc-base file(s)...
>>> > Registering documents with scrollkeeper...
>>> > Configurando python-mock (0.6.0-1) ...
>>> > Procesando disparadores para python-support ...
>>> > ivan@ivan-laptop:~/mdig/mdig$ nosetests -v mdig/tests
>>> > test_act_on_options (mdig.tests.test_actions.ExportActionTest) ... ok
>>> > test_create (mdig.tests.test_actions.ExportActionTest) ... ok
>>> > test_do_instance_images (mdig.tests.test_actions.ExportActionTest) ...
>>> > ok
>>> > test_do_instance_map_pack (mdig.tests.test_actions.ExportActionTest)
>>> > ... ok
>>> > test_do_me (mdig.tests.test_actions.ExportActionTest) ... ok
>>> > Failure: AttributeError ('function' object has no attribute 'object')
>>> > ...
>>> > ERROR
>>> > test_add_analysis_result
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ... ok
>>> > test_add_envelope
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest)
>>> > ... ok
>>> > test_get_mapset
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest)
>>> > ... ok
>>> > test_listeners
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ...
>>> > ok
>>> > test_load_replicates
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ... ok
>>> > test_set_mapset
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest)
>>> > ... ok
>>> > test_str (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ...
>>> > ok
>>> > test_update_occupancy_env_missing_maps
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ... ok
>>> > test_update_occupancy_env_strategy
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ... ok
>>> > test_update_occupancy_envelope
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest) ... ok
>>> > test_update_xml
>>> > (mdig.tests.test_dispersalinstance.DispersalInstanceTest)
>>> > ... ok
>>> > test_compare_version
>>> > (mdig.tests.test_dispersalmodel.CompareVersionTest) ...
>>> > ok
>>> > test_empty_model (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_get_instances (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ...
>>> > ok
>>> > test_get_resources (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ...
>>> > ok
>>> > test_get_weird_resources
>>> > (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_hard_reset (mdig.tests.test_dispersalmodel.DispersalModelTest) ...
>>> > ok
>>> > test_is_complete (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_log_instance_times
>>> > (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_model_constructor
>>> > (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_null_bitmask (mdig.tests.test_dispersalmodel.DispersalModelTest)
>>> > ... ok
>>> > test_run (mdig.tests.test_dispersalmodel.DispersalModelTest) ... ok
>>> > test_construct
>>> > (mdig.tests.test_grassinterface.GRASSCommandExceptionTest)
>>> > ... ok
>>> > test_no_args (mdig.tests.test_grassinterface.GRASSCommandExceptionTest)
>>> > ...
>>> > ok
>>> > test_backup_region (mdig.tests.test_grassinterface.GRASSInterfaceTest)
>>> > ...
>>> > ok
>>> > test_check_environment
>>> > (mdig.tests.test_grassinterface.GRASSInterfaceTest)
>>> > ... ok
>>> > test_check_paths (mdig.tests.test_grassinterface.GRASSInterfaceTest)
>>> > ... ok
>>> > test_clear_monitor (mdig.tests.test_grassinterface.GRASSInterfaceTest)
>>> > ...
>>> > ok
>>> > test_normalise_map_colors
>>> > (mdig.tests.test_grassinterface.GRASSInterfaceTest) ... ok
>>> > test_paint_map (mdig.tests.test_grassinterface.GRASSInterfaceTest) ...
>>> > ok
>>> > test_construct
>>> > (mdig.tests.test_grassinterface.MapNotFoundExceptionTest) ...
>>> > ok
>>> > test_change_map_type (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_create_mapcalc_map (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_create_name_map (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_create_sites_map (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_create_sites_map_w_comment (mdig.tests.test_grassmap.GrassMapTest)
>>> > ...
>>> > ok
>>> > test_create_value_map (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_use_existing_map (mdig.tests.test_grassmap.GrassMapTest) ... ok
>>> > test_create_strategy
>>> > (mdig.tests.test_managementstrategy.ManagementStrategyTest) ... ok
>>> > test_s_with_delay
>>> > (mdig.tests.test_managementstrategy.ManagementStrategyTest) ... ok
>>> > test_s_with_ls
>>> > (mdig.tests.test_managementstrategy.ManagementStrategyTest)
>>> > ... ok
>>> > test_treatment_no_node
>>> > (mdig.tests.test_managementstrategy.ManagementStrategyTest) ... ok
>>> > test_check_info (mdig.tests.test_migrate.Migrate029Test) ... ok
>>> > test_migrate_repository (mdig.tests.test_migrate.Migrate029Test) ... ok
>>> > test_no_split_instances (mdig.tests.test_migrate.Migrate029Test) ... ok
>>> > test_split_instances (mdig.tests.test_migrate.Migrate029Test) ... ok
>>> > test_migrate_old_repository (mdig.tests.test_migrate.Migrate0Test) ...
>>> > ok
>>> > empty_repository_test
>>> > (mdig.tests.test_modelrepository.ModelRepositoryTest)
>>> > ... ok
>>> > normal_repository_test
>>> > (mdig.tests.test_modelrepository.ModelRepositoryTest)
>>> > ... ok
>>> > remove_model_test (mdig.tests.test_modelrepository.ModelRepositoryTest)
>>> > ...
>>> > ok
>>> > remove_other_test (mdig.tests.test_modelrepository.ModelRepositoryTest)
>>> > ...
>>> > ok
>>> > test_add_lifestage_model
>>> > (mdig.tests.test_modelrepository.ModelRepositoryTest) ... ok
>>> > test_lifestage_model_missing_files
>>> > (mdig.tests.test_modelrepository.ModelRepositoryTest) ... ok
>>> > test_create_region (mdig.tests.test_region.RegionTest) ... ok
>>> > test_extents (mdig.tests.test_region.RegionTest) ... ok
>>> > test_check_complete (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_check_complete_on_creation
>>> > (mdig.tests.test_replicate.ReplicateTest)
>>> > ... ok
>>> > test_create_w_no_instance (mdig.tests.test_replicate.ReplicateTest) ...
>>> > ok
>>> > test_create_w_no_node (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_delete_maps (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_get_img_filenames (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_get_initial_maps (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_get_time_stamp (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_map_name_base (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_null_bitmask (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_previous_maps (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_record_maps (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_reset (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_run (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_run_w_analysis (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_run_w_lifestage (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_run_w_management (mdig.tests.test_replicate.ReplicateTest) ... ok
>>> > test_worker_start (mdig.tests.test_webservice.MDiGWorkTest) ... ok
>>> > test_run (mdig.tests.test_webservice.ResultsMonitorTest) ... ok
>>> > test_404 (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_add_and_delete_model (mdig.tests.test_webservice.WebServiceTest)
>>> > ...
>>> > FAIL
>>> > test_add_model_to_repo (mdig.tests.test_webservice.WebServiceTest) ...
>>> > ERROR
>>> > test_add_to_map_pack_lfu (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_change_to_mapset (mdig.tests.test_webservice.WebServiceTest) ...
>>> > ok
>>> > test_delete_unknown_model (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_get_map_pack_usage (mdig.tests.test_webservice.WebServiceTest) ...
>>> > ok
>>> > test_handle_alternate_location
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_handle_bad_model (mdig.tests.test_webservice.WebServiceTest) ...
>>> > ok
>>> > test_handle_index (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_handle_model_bad_instance
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_handle_model_bad_replicate
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_handle_model_instance (mdig.tests.test_webservice.WebServiceTest)
>>> > ...
>>> > ok
>>> > test_handle_model_replicate (mdig.tests.test_webservice.WebServiceTest)
>>> > ...
>>> > ok
>>> > test_handle_model_w_lifestages
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_models_redirect (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_process_tasks (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_process_tasks_errors (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_purge_oldest_map_packs (mdig.tests.test_webservice.WebServiceTest)
>>> > ...
>>> > ok
>>> > test_run_instance (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_run_model (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_shutdown_webapp (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_start_webapp (mdig.tests.test_webservice.WebServiceTest) ... ok
>>> > test_submit_model (mdig.tests.test_webservice.WebServiceTest) ... ERROR
>>> > test_submit_model_already_exists
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_submit_model_bad_xml (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > test_submit_model_missing_files
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ... ok
>>> > ======================================================================
>>> > ERROR: Failure: AttributeError ('function' object has no attribute
>>> > 'object')
>>> > ----------------------------------------------------------------------
>>> > Traceback (most recent call last):
>>> > File
>>> >
>>> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> > line 390, in loadTestsFromName
>>> > addr.filename, addr.module)
>>> > File
>>> >
>>> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> > line 39, in importFromPath
>>> > return self.importFromDir(dir_path, fqname)
>>> > File
>>> >
>>> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> > line 86, in importFromDir
>>> > mod = load_module(part_fqname, fh, filename, desc)
>>> > File "/home/ivan/mdig/mdig/mdig/tests/test_analysiscommand.py", line
>>> > 18,
>>> > in <module>
>>> > class AnalysisCommandTest(unittest.TestCase):
>>> > File "/home/ivan/mdig/mdig/mdig/tests/test_analysiscommand.py", line
>>> > 69,
>>> > in AnalysisCommandTest
>>> > @patch.object(AnalysisCommand, 'run_command_once')
>>> > AttributeError: 'function' object has no attribute 'object'
>>> > ======================================================================
>>> > ERROR: test_add_model_to_repo
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ----------------------------------------------------------------------
>>> > Traceback (most recent call last):
>>> > File "/home/ivan/mdig/mdig/mdig/tests/test_webservice.py", line 272,
>>> > in
>>> > test_add_model_to_repo
>>> > webui.add_model_to_repo(data)
>>> > File "/home/ivan/mdig/mdig/mdig/webui.py", line 277, in
>>> > add_model_to_repo
>>> > model_name = mdig.repository.add_model(model_fn)
>>> > File "/home/ivan/mdig/mdig/mdig/modelrepository.py", line 62, in
>>> > add_model
>>> > "' already exists in the repository. Replace with -o.")
>>> > RepositoryException: RepositoryException: The model 'variable_test'
>>> > already
>>> > exists in the repository. Replace with -o.
>>> > -------------------- >> begin captured logging << --------------------
>>> > mdig.repos: INFO: Using GRASS DB location /tmp/mdig_test_aMSQUC/test
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.model: DEBUG: Opening
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variables/mdig/model.xml
>>> > mdig.grass: DEBUG: Change to mapset variables@grass_location
>>> > mdig.model: DEBUG: Opening /tmp/mdig_webRJFspM/model.xml
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > --------------------- >> end captured logging << ---------------------
>>> > ======================================================================
>>> > ERROR: test_submit_model (mdig.tests.test_webservice.WebServiceTest)
>>> > ----------------------------------------------------------------------
>>> > Traceback (most recent call last):
>>> > File "/home/ivan/mdig/mdig/mdig/tests/test_webservice.py", line 315,
>>> > in
>>> > test_submit_model
>>> > r = self.urlopen('/models/variable_test/del',method='POST')
>>> > File "/home/ivan/mdig/mdig/mdig/tests/tools.py", line 61, in urlopen
>>> > response = self.wsgiapp(env, start_response)
>>> > File "/usr/lib/python2.6/wsgiref/validate.py", line 176, in lint_app
>>> > iterator = application(environ, start_response_wrapper)
>>> > File "/home/ivan/mdig/mdig/mdig/bottle.py", line 543, in __call__
>>> > out = self.handle(request.path, request.method)
>>> > File "/home/ivan/mdig/mdig/mdig/bottle.py", line 462, in handle
>>> > return handler(**args)
>>> > File "/home/ivan/mdig/mdig/mdig/webui.py", line 220, in del_model
>>> > mdig.repository.remove_model(model, force=True)
>>> > File "/home/ivan/mdig/mdig/mdig/modelrepository.py", line 155, in
>>> > remove_model
>>> > except WindowsError, e:
>>> > NameError: global name 'WindowsError' is not defined
>>> > -------------------- >> begin captured logging << --------------------
>>> > mdig.repos: INFO: Using GRASS DB location /tmp/mdig_test_aMSQUC/test
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.model: DEBUG: Opening
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variables/mdig/model.xml
>>> > mdig.grass: DEBUG: Change to mapset variables@grass_location
>>> > mdig.model: DEBUG: Opening /tmp/mdig_webmhepGr/model.xml
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.model: DEBUG: Opening
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variable_test/mdig/model.xml
>>> > mdig.grass: DEBUG: Change to mapset PERMANENT@grass_location
>>> > mdig.model: DEBUG: Total number of instances: 6
>>> > mdig.model: DEBUG: {'a': {'var': [['2', '3'], ['2', '2'], [None, '2'],
>>> > [None, '3'], ['2', '5'], [None, '5']], 'var_keys': ['agem', 'd1'],
>>> > 'reps':
>>> > [2, 2, 2, 2, 2, 2]}}
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf06824>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '3'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i0]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf18194>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '2'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i1]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf182ac>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '2'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i2]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf183c4>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '3'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i3]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf184dc>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '5'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i4]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > cf185f4>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '5'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i5]
>>> > --------------------- >> end captured logging << ---------------------
>>> > ======================================================================
>>> > FAIL: test_add_and_delete_model
>>> > (mdig.tests.test_webservice.WebServiceTest)
>>> > ----------------------------------------------------------------------
>>> > Traceback (most recent call last):
>>> > File "/home/ivan/mdig/mdig/mdig/tests/test_webservice.py", line 292,
>>> > in
>>> > test_add_and_delete_model
>>> > self.assertEqual(r['code'],303)
>>> > AssertionError: 500 != 303
>>> > -------------------- >> begin captured stdout << ---------------------
>>> > Successfully added model to mapset
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variable_test
>>> > global name 'WindowsError' is not defined
>>> > --------------------- >> end captured stdout << ----------------------
>>> > -------------------- >> begin captured logging << --------------------
>>> > mdig.repos: INFO: Using GRASS DB location /tmp/mdig_test_aMSQUC/test
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.model: DEBUG: Opening
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variables/mdig/model.xml
>>> > mdig.grass: DEBUG: Change to mapset variables@grass_location
>>> > mdig.model: DEBUG: Opening /tmp/mdig_webqmfRBZ/model.xml
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.grass: DEBUG: Change to mapset PERMANENT@grass_location
>>> > mdig.repos: INFO: Creating mapset for model variable_test
>>> > mdig.grass: DEBUG: exec: g.mapset -c mapset=variable_test
>>> > location=grass_location
>>> > mdig.grass: DEBUG: Change to mapset variable_test@grass_location
>>> > mdig.repos: INFO: Created mapset for model variable_test
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_delay_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No xml files or 'original' file in mdig dir of
>>> > mapset
>>> > management_event_i0 (location: grass_location)
>>> > mdig.repos: WARNING: No model.xml and more than one xml file in
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/multi_xml_files/mdig
>>> > mdig.model: DEBUG: Opening
>>> > /tmp/mdig_test_aMSQUC/test/grass_location/variable_test/mdig/model.xml
>>> > mdig.grass: DEBUG: Change to mapset PERMANENT@grass_location
>>> > mdig.model: DEBUG: Total number of instances: 6
>>> > mdig.model: DEBUG: {'a': {'var': [['2', '3'], ['2', '2'], [None, '2'],
>>> > [None, '3'], ['2', '5'], [None, '5']], 'var_keys': ['agem', 'd1'],
>>> > 'reps':
>>> > [2, 2, 2, 2, 2, 2]}}
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84b874>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '3'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i0]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84b964>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '2'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i1]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84ba7c>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '2'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i2]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84bb94>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '3'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i3]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84bcac>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', '2'),('d1', '5'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i4]
>>> > mdig.model: DEBUG: Added "completed" node: <Element completed at
>>> > c84bdc4>
>>> > mdig.instance: DEBUG: [Instance - p: {('agem', None),('d1', '5'),};
>>> > region:
>>> > a; replicates: 0/2; active: None mapset: variable_test_i5]
>>> > --------------------- >> end captured logging << ---------------------
>>> > ----------------------------------------------------------------------
>>> > Ran 107 tests in 50.589s
>>> > FAILED (errors=3, failures=1)
>>> >
>>> > I am happy because it seems almost finished.
>>> > May be I need to install something else.
>>> > What can I do?
>>> > Thanks !!!
>>> >
>>> >
>>> > 2010/12/23 Joel Pitt <jo...@fruitionnz.com>
>>> >>
>>> >> Hi Ivan - sorry for these issues... MDiG is usually used by various
>>> >> people in Australasia and I've often helped them personally get
>>> >> started.
>>> >>
>>> >> I'll be sure to update the documentation so it's a smoother process.
>>> >>
>>> >> What you need to do is install the python mock module:
>>> >>
>>> >> apt-get install python-mock
>>> >>
>>> >> Cheers
>>> >>
>>> >> Joel Pitt, PhD | http://ferrouswheel.me | +852 6683 9980
>>> >> M-Lab AI Project and OpenCog Developer | http://opencog.org
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On 23 December 2010 22:44, Ivan Henriquez Rivera
>>> >> <ivan.he...@upr.edu>
>>> >> wrote:
>>> >> > Hi Joel,
>>> >> > Now I get this message:
>>> >> > ~/mdig/mdig$ nosetests -v mdig/tests
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> > Failure: ImportError (No module named mock) ... ERROR
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_actions.py", line 2, in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> > -------------------- >> begin captured logging <<
>>> >> > --------------------
>>> >> > mdig.config: DEBUG: MDIG config/working dir is /home/ivan/.mdig
>>> >> > mdig.config: DEBUG: Created new MDiGConfig instance
>>> >> > --------------------- >> end captured logging <<
>>> >> > ---------------------
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)Hi Joel,
>>> >> > Now I get this message:
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_analysiscommand.py",
>>> >> > line
>>> >> > 2, in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_dispersalinstance.py",
>>> >> > line
>>> >> > 2,
>>> >> > in <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_dispersalmodel.py",
>>> >> > line 2,
>>> >> > in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_grassinterface.py",
>>> >> > line 2,
>>> >> > in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_grassmap.py", line 2,
>>> >> > in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_managementstrategy.py",
>>> >> > line 2,
>>> >> > in <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_migrate.py", line 2, in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_modelrepository.py",
>>> >> > line
>>> >> > 2, in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_region.py", line 2, in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_replicate.py", line 2,
>>> >> > in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ======================================================================
>>> >> > ERROR: Failure: ImportError (No module named mock)
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Traceback (most recent call last):
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> > line 390, in loadTestsFromName
>>> >> > addr.filename, addr.module)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 39, in importFromPath
>>> >> > return self.importFromDir(dir_path, fqname)
>>> >> > File
>>> >> >
>>> >> >
>>> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> > line 86, in importFromDir
>>> >> > mod = load_module(part_fqname, fh, filename, desc)
>>> >> > File "/home/ivan/mdig/mdig/mdig/tests/test_webservice.py", line 2,
>>> >> > in
>>> >> > <module>
>>> >> > from mock import *
>>> >> > ImportError: No module named mock
>>> >> >
>>> >> > ----------------------------------------------------------------------
>>> >> > Ran 12 tests in 15.860s
>>> >> > FAILED (errors=12)
>>> >> >
>>> >> > Apparently I must have done something wrong during installation.
>>> >> > What do you suggest?
>>> >> > Thank Joel. Apologize for any inconvenience.
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > 2010/12/22 Joel Pitt <jo...@fruitionnz.com>
>>> >> >>
>>> >> >> Hi Ivan - sorry, the TESTING file is slightly incorrect...
>>> >> >>
>>> >> >> The command should be:
>>> >> >>
>>> >> >> ~/mdig/mdig$ nosetests -v mdig/tests
>>> >> >>
>>> >> >> J
>>> >> >>
>>> >> >> On 22 December 2010 00:48, Ivan Henriquez Rivera
>>> >> >> <ivan.he...@upr.edu>
>>> >> >> wrote:
>>> >> >> > Hello Joel,
>>> >> >> > Thanks for ansering!
>>> >> >> > I did what TESTING file says and I got:
>>> >> >> > ~/mdig/mdig$ nosetests -v mdig/tests/Model.py
>>> >> >> > Failure: ImportError (No module named Model) ... ERROR
>>> >> >> >
>>> >> >> >
>>> >> >> > ======================================================================
>>> >> >> > ERROR: Failure: ImportError (No module named Model)
>>> >> >> >
>>> >> >> >
>>> >> >> > ----------------------------------------------------------------------
>>> >> >> > Traceback (most recent call last):
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> >> > line 390, in loadTestsFromName
>>> >> >> > addr.filename, addr.module)
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> >> > line 39, in importFromPath
>>> >> >> > return self.importFromDir(dir_path, fqname)
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> >> > line 71, in importFromDir
>>> >> >> > fh, filename, desc = find_module(part, path)
>>> >> >> >
>>> >> >> > ImportError: No module named Model
>>> >> >> >
>>> >> >> > -------------------- >> begin captured logging <<
>>> >> >> > --------------------
>>> >> >> >
>>> >> >> > mdig.config: DEBUG: MDIG config/working dir is /home/ivan/.mdig
>>> >> >> >
>>> >> >> > --------------------- >> end captured logging <<
>>> >> >> > ---------------------
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > ----------------------------------------------------------------------
>>> >> >> >
>>> >> >> > Ran 1 test in 0.008s
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > FAILED (errors=1)
>>> >> >> > I did also:
>>> >> >> > ~/mdig/mdig$ nosetests -v --with-coverage mdig/tests/Model.py
>>> >> >> >
>>> >> >> > Failure: ImportError (No module named Model) ... ERROR
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > ======================================================================
>>> >> >> >
>>> >> >> > ERROR: Failure: ImportError (No module named Model)
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > ----------------------------------------------------------------------
>>> >> >> >
>>> >> >> > Traceback (most recent call last):
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/loader.py",
>>> >> >> > line 390, in loadTestsFromName
>>> >> >> > addr.filename, addr.module)
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> >> > line 39, in importFromPath
>>> >> >> > return self.importFromDir(dir_path, fqname)
>>> >> >> > File
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > "/usr/local/lib/python2.6/dist-packages/nose-1.0.0-py2.6.egg/nose/importer.py",
>>> >> >> > line 71, in importFromDir
>>> >> >> > fh, filename, desc = find_module(part, path)
>>> >> >> > ImportError: No module named Model
>>> >> >> > -------------------- >> begin captured logging <<
>>> >> >> > --------------------
>>> >> >> > mdig.config: DEBUG: MDIG config/working dir is /home/ivan/.mdig
>>> >> >> > --------------------- >> end captured logging <<
>>> >> >> > ---------------------
>>> >> >> > Name Stmts Miss Cover Missing
>>> >> >> > ------------------------------------------------------
>>> >> >> > mdig 19 9 53% 31-40, 74
>>> >> >> > mdig.config 152 106 30% 57, 65-68, 98-108,
>>> >> >> > 113-118,
>>> >> >> > 123-132, 225-236, 240-242, 248-278, 281-306, 309-330, 345-350
>>> >> >> > mdig.contrib 0 0 100%
>>> >> >> > mdig.contrib.configobj 1112 958 14% 72, 90-95,
>>> >> >> > 144-148,
>>> >> >> > 158-161,
>>> >> >> > 164, 167, 170-174, 177, 180-188, 191-198, 201-202, 205, 208,
>>> >> >> > 215-217,
>>> >> >> > 227-229, 252, 275, 290-291, 313, 318-366, 375-400, 419, 429-431,
>>> >> >> > 449-458,
>>> >> >> > 469, 491-492, 495-496, 506-522, 527-539, 543-562, 567-579,
>>> >> >> > 596-638,
>>> >> >> > 643-649,
>>> >> >> > 654-657, 664-665, 673-681, 686-692, 703-710, 715-719, 724, 729,
>>> >> >> > 734,
>>> >> >> > 739,
>>> >> >> > 744, 751, 756-761, 783-795, 817-822, 834-852, 902-937, 968-981,
>>> >> >> > 1004,
>>> >> >> > 1026,
>>> >> >> > 1045-1048, 1060-1064, 1077-1081, 1201-1242, 1246-1339, 1343-1371,
>>> >> >> > 1375-1380,
>>> >> >> > 1407-1483, 1488-1491, 1500-1510, 1515-1519, 1527-1530, 1535-1698,
>>> >> >> > 1709-1717,
>>> >> >> > 1727-1736, 1741-1746, 1768-1815, 1819-1825, 1829-1835, 1843-1884,
>>> >> >> > 1889-1919,
>>> >> >> > 1926-1939, 1948-1968, 1974-1978, 1987, 1996-2001, 2021-2113,
>>> >> >> > 2152-2320,
>>> >> >> > 2325-2331, 2341-2356, 2373, 2377-2379, 2414-2439, 2459-2465
>>> >> >> > ------------------------------------------------------
>>> >> >> > TOTAL 1283 1073 16%
>>> >> >> >
>>> >> >> >
>>> >> >> > ----------------------------------------------------------------------
>>> >> >> > Ran 1 test in 0.008s
>>> >> >> > FAILED (errors=1)
>>> >> >> > What does this mean?
>>> >> >> > I tried to install grass and mdig again but the same message
>>> >> >> > appeared.
>>> >> >> > During installation there were no error messages. I checked the
>>> >> >> > requirements
>>> >> >> > also.
>>> >> >> > Thanks for your help!
>>> >> >> > Iván
>>> >> >> >
>>> >> >> > 2010/12/21 Joel Pitt <jo...@fruitionnz.com>
>>> >> >> > --
>>> >> >> > Iván Henríquez
>>> >> >> >
>>> >> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Iván Henríquez
>>> >> >
>>> >> >
>>> >
>>> >
>>> >
>>> > --
>>> > Iván Henríquez
>>> >
>>> >
>>
>>
>>
>> --
>> Iván Henríquez
>>
>
>
>
> --
> Iván Henríquez
>
>
On 8 February 2011 11:41, Ivan Henriquez Rivera <ivan.he...@upr.edu> wrote:
> lifestage.run(current_interval,self,self.temp_map_names[ls_key],strategy)
> File "/home/ivan/mdig/mdig/mdig/lifestage.py", line 246, in run
> e.run(temp_map_names[0], temp_map_names[1], rep, self.populationBased)
> File "/home/ivan/mdig/mdig/mdig/event.py", line 171, in run
> grass.get_g().run_command(cmd)
> File "/home/ivan/mdig/mdig/mdig/grass.py", line 956, in run_command
> raise GRASSCommandException(commandstring,self.stderr,ret)
> mdig.grass.GRASSCommandException: Command 'r.dispersal.neighbour
> input=6177_all_933547 shape=186 -b radius=1 output=6177_all_371847 ' exiting
> with code 127, stderr: '/bin/sh: r.dispersal.neighbour: not found'
Try replacing it with r.mdig.neighbour
r.dispersal was the old name prefix I used for my custom GRASS commands.
> Also, I would like to know if I can define the initial distribution by a
> raster and
> how to do it.
Yes... for each lifestage (since the a population's lifestages may be
dispersed differently), add:
<initialDistribution region="a">
<map>mapname</map>
</initialDistribution>
You have to make sure the region id (here it's "a") matches the
regions defined earlier in the XML.
You can also use map algebra expressions using <mapcalc> or a constant
value using <value>.
> One question more: Is the background map the same than a suitability map?
> Thank you!
The background map is just for graphical representation. It doesn't
affect the model dynamics.
e.g. you might want to create a composite of a DEM and the suitability
map instead of just overlaying the output graphics on the suitability
map.
Cheers,
Joel
Thanks ;-)
On 9 February 2011 13:04, Joel Pitt <jo...@fruitionnz.com> wrote:
> Try removing <png>...</png> from the <output> tag.
>
> It may be that it's broken as the preferred method to output png
> images is to use the "export" action.
>
> e.g. mdig export -i model_name
>
> I'll try to fix this sometime soon.
>
> J
>
> On 8 February 2011 22:13, Ivan Henriquez Rivera <ivan.he...@upr.edu> wrote:
>> Joel, I replaced r.dispersal with r.mdig at each command.
>> I got this:
>>
>> ./mdig.py run mpellita5
>> 20110208 09:45:18 [mdig.repos] INFO: Using GRASS DB location
>> /home/ivan/grassdata/locations
>> 20110208 09:45:18 [mdig.model] INFO: Starting simulations at
>> 2011-02-08T09:45:18.739623
>> Replicate 1/1 of exp. instance
>> 20110208 09:45:18 [mdig.replicate] INFO: Replicate 1/1 of exp. instance
>> 20110208 09:45:18 [mdig.grass] INFO: Creating map 2255__394073 using
>> coordinates [(245900, 150000, 1)]
>> 20110208 09:45:43 [mdig.replicate] INFO: t=1990
>> 20110208 09:45:44 [mdig.replicate] INFO: Interval 1 - Lifestage "all"
>> started
>> 20110208 09:50:04 [mdig.replicate] INFO: Interval 1 completed.
>> 20110208 09:50:04 [mdig.replicate] INFO: Lifestage all - Running analyses
>> 20110208 09:50:33 [mdig.replicate] INFO: Lifestage all - Analyses complete
>> Traceback (most recent call last):
>> File "./mdig.py", line 249, in <module>
>> main(sys.argv[1:])
>> File "./mdig.py", line 171, in main
>> the_action.do_me(exp)
>> File "/home/ivan/mdig/mdig/mdig/actions.py", line 275, in do_me
>> mdig_model.run()
>> File "/home/ivan/mdig/mdig/mdig/model.py", line 459, in run
>> instance.run()
>> File "/home/ivan/mdig/mdig/mdig/instance.py", line 271, in run
>> self._run_replicate(rep)
>> File "/home/ivan/mdig/mdig/mdig/instance.py", line 281, in _run_replicate
>> rep.run()
>> File "/home/ivan/mdig/mdig/mdig/replicate.py", line 405, in run
>> self.fire_time_completed(t)
>> File "/home/ivan/mdig/mdig/mdig/replicate.py", line 481, in
>> fire_time_completed
>> ls_filename = l.replicate_update(self,t)
>> File "/home/ivan/mdig/mdig/mdig/outputformats.py", line 78, in
>> replicate_update
>> if current_region.getBackgroundMap():
>> AttributeError: Region instance has no attribute 'getBackgroundMap'
>>
>> What could it be the problem?
>> many thanks! ; )
>>
>> 2011/2/7 Joel Pitt <jo...@fruitionnz.com>
>> --
>> Iván Henríquez
>>
>>
>
Only repayment requested is to mention MDiG in any publications you
use it for and perhaps cite the first paper I used it in:
Pitt JPW, Worner SP and Suarez A (2009) Predicting Argentine ant
spread over the heterogeneous landscape using a spatially-explicit
stochastic model. Ecological Applications 19: 1176-1186
But it's up to you. ;-)
Also, if you think the instructions or documentation could be made
easier to understand, feel free to update the wiki so that new users
will have an easier job when they try to use it.
Cheers
Joel Pitt, PhD | http://ferrouswheel.me | +852 6683 9980
M-Lab AI Project and OpenCog Developer | http://opencog.org