[WIP] Run meta analysis for a settings file API #3053
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This API
/api/ma/run
will run a meta analysis if a settings file is provided in the body of the request. The settings file should me send as xml.Upon successful run of the meta analysis the response will consist the data from the
post.distns.MA.Rdata
file from the output directory as a list.Sample request on Postman
Sample settings file
<?xml version="1.0"?> <info> <notes/> <userid>-1</userid> <username/> <date>2022/09/29 15:46:00 +0000</date> </info> <outdir>/data/workflows/PEcAn_99000000004</outdir> <database> <bety> <user>bety</user> <password>bety</password> <host>postgres</host> <port>5432</port> <dbname>bety</dbname> <driver>PostgreSQL</driver> <write>true</write> </bety> <dbfiles>/data/dbfiles</dbfiles> </database> <pfts> <pft> <name>temperate.coniferous</name> </pft> </pfts> <meta.analysis> <iter>3000</iter> <random.effects> <on>FALSE</on> <use_ghs>TRUE</use_ghs> </random.effects> </meta.analysis> <ensemble> <size>1</size> <variable>NPP</variable> <samplingspace> <parameters> <method>uniform</method> </parameters> <met> <method>sampling</method> </met> </samplingspace> </ensemble> <model> <id>1000000014</id> </model> <workflow> <id>99000000004</id> </workflow> <run> <site> <id>772</id> <met.start>1999-01-01 00:00:00</met.start> <met.end>2003-12-31 00:00:00</met.end> </site> <inputs> <met> <id>5000000006</id> </met> </inputs> <start.date>2000/01/01</start.date> <end.date>2000/12/31</end.date> </run> <host> <name>localhost</name> <rabbitmq> <uri>amqp://guest:guest@rabbitmq/%2F</uri> <queue>SIPNET_r136</queue> </rabbitmq> </host>
Sample Output of the API
{ "status": "Meta Analysis ran successfully", "data": [ { "distn": "beta", "parama": 2.63, "paramb": 6.52, "n": 0, "_row": "growth_resp_factor" }, { "distn": "gamma", "parama": 4599.0942, "paramb": 13859.064, "n": 363, "_row": "leaf_turnover_rate" }, { "distn": "gamma", "parama": 130531.937, "paramb": 7335.3038, "_row": "root_respiration_rate" }, { "distn": "norm", "parama": 0.6032, "paramb": 0.0322, "_row": "root_turnover_rate" }, { "distn": "norm", "parama": 16.8391, "paramb": 0.1774, "_row": "Amax" }, { "distn": "norm", "parama": 1.4098, "paramb": 0.0252, "_row": "leaf_respiration_rate_m2" }, { "distn": "gamma", "parama": 1571.2799, "paramb": 303.327, "n": 455, "_row": "SLA" }, { "distn": "norm", "parama": 50.4784, "paramb": 0.182, "n": 291, "_row": "leafC" }, { "distn": "norm", "parama": 0, "paramb": 3, "_row": "Vm_low_temp" }, { "distn": "unif", "parama": 0.6, "paramb": 0.9, "_row": "AmaxFrac" }, { "distn": "unif", "parama": 5, "paramb": 40, "_row": "psnTOpt" }, { "distn": "unif", "parama": 0, "paramb": 100, "_row": "stem_respiration_rate" }, { "distn": "unif", "parama": 0.38, "paramb": 0.62, "_row": "extinction_coefficient" }, { "distn": "unif", "parama": 4, "paramb": 27, "_row": "half_saturation_PAR" }, { "distn": "unif", "parama": 0.01, "paramb": 0.25, "_row": "dVPDSlope" }, { "distn": "unif", "parama": 1, "paramb": 3, "_row": "dVpdExp" }, { "distn": "unif", "parama": 1.4, "paramb": 2.6, "_row": "veg_respiration_Q10" }, { "distn": "unif", "parama": 1.4, "paramb": 5, "_row": "fine_root_respiration_Q10" }, { "distn": "unif", "parama": 1.4, "paramb": 5, "_row": "coarse_root_respiration_Q10" } ] }
Review Time Estimate
Types of changes
Checklist: