ariesteam / aries

http://www.ariesonline.org
GNU General Public License v3.0
6 stars 1 forks source link

flood flow issues (same as before)? #25

Closed kbagstad closed 12 years ago

kbagstad commented 12 years ago

@lambdatronic

kbagstad commented 12 years ago

Trying to run the model -o floodtest.nc core.models.flood-puget/flood-regulation-public-assets-100 core.contexts.beta/wria9_256 (or for that matter, any of the flood flow models) yields the following error "java.lang.Exception: Unrecognized datasource type:" Not sure if this is related to issue #11, or the fact that for flooding we have the presence of users rather than their quantity mapped on the landscape by our use models. The error message I get is:

We are inside runSPAN! Unpacking observation into data-layers. Extracting Precipitation layer. Inside unpack-datasource! Checking datasource type... #<MemDoubleContextualizedDatasource MD[floodService:Precipitation: ]> It's deterministic. Extracting FloodSink layer. Inside unpack-datasource! Checking datasource type... #<MemDoubleContextualizedDatasource MD[floodService:FloodSink: ]> It's deterministic. Extracting FloodPublicAssetsUse100 layer. Inside unpack-datasource! Checking datasource type... #<MemDoubleContextualizedDatasource MD[floodService:FloodPublicAssetsUse100: ]> It's deterministic. Extracting flow layers: (Altitude River Floodplains100 Levees) Inside unpack-datasource! Checking datasource type... nil java.lang.RuntimeException: java.lang.Exception: Unrecognized datasource type: at clojure.lang.LazyCons.first(LazyCons.java:44) at clojure.lang.RT.first(RT.java:539) at clojure.core$first2743.invoke(core.clj:40) at clojure.core$into3590.invoke(core.clj:1620) at clj_span.aries_span_bridge$layer_map_from_observation5980.invoke(aries_span_bridge.clj:262) at clj_span.aries_span_bridge$span_driver5990.invoke(aries_span_bridge.clj:298) at aries$get_span_proxy4139$fn4141.invoke(aries-core.clj:25) at clojure.proxy.java.lang.Object$SPANProxy.runSPAN(Unknown Source) at org.integratedmodelling.aries.core.implementations.observations.SPANTransformer.transform(SPANTransformer.java:161) at org.integratedmodelling.corescience.context.ObservationContext.processTransformations(ObservationContext.java:719) at org.integratedmodelling.corescience.context.ObservationContext.processTransformations(ObservationContext.java:637) at org.integratedmodelling.corescience.context.ObservationContext.run(ObservationContext.java:758) at org.integratedmodelling.corescience.ObservationFactory.contextualize(ObservationFactory.java:73) at org.integratedmodelling.modelling.model.ModelFactory$ContextualizingModelResult.getResult(ModelFactory.java:253) at org.integratedmodelling.modelling.commands.ModelCommand.execute(ModelCommand.java:126) at org.integratedmodelling.thinklab.command.CommandManager.submitCommand(CommandManager.java:144) at org.integratedmodelling.thinklab.commandline.GraphicalShell.execute(GraphicalShell.java:305) at org.integratedmodelling.thinklab.commandline.GraphicalShell.startConsole(GraphicalShell.java:264) at org.integratedmodelling.thinklab.shell.ShellApplication.startApplication(ShellApplication.java:127) at org.java.plugin.boot.Boot.boot(Boot.java:346) at org.java.plugin.boot.Boot.main(Boot.java:243) Caused by: java.lang.Exception: Unrecognized datasource type: at clj_span.aries_span_bridge$fn5922.invoke(aries_span_bridge.clj:206) at clojure.lang.MultiFn.invoke(MultiFn.java:156) at clj_span.aries_span_bridge$layer_map_from_observation5980$fn5985.invoke(aries_span_bridge.clj:263) at clojure.core$map3371$fn__3374.invoke(core.clj:1278) at clojure.lang.LazyCons.first(LazyCons.java:40) ... 20 more

lambdatronic commented 12 years ago

This is happening while unpacking the observations for the routing layers (i.e. Altitude, River, Flooplains100, Levees). It indicates that they were not successfully passed from Ferd's code to mine. We've seen this happen before. If your defmodel span statement contains the correct :context models, then this is probably just a burp in the system. Try rerunning the command. That fixed it last time. Blegh.

kbagstad commented 12 years ago

No dice I'm afraid - tried playing with the context lists and re-running multiple times, all with the same results.

lambdatronic commented 12 years ago

Okay, after a bit of hacking on this issue, I recognized that there were two models defined for the Floodplains100 and Floodplains500 concepts. This kind of redundancy is no good (at least when it comes to unpacking results from SPAN statements). So somehow Ferd's contextualizer was mixing up which Floodplains100 model result to hand off to my code when running the command you are having trouble with. I removed this redundancy in the code, and now the model runs in the chehalis context. However, I'm still getting the same error in the wria9_256 context. This is happening on Ferd's side though. It's not me, so I'm adding him to this issue.

@fvilla

fvilla commented 12 years ago

fixed - the Altitude concept was not being kept in the context on account of being secondary to other models, so it was not available to span even though it was in its context (a really tough one). Should not happen again hopefully.