.. _popy_run:

popy_run
##########

The most important command in the suite of :ref:`popy_tools` is :command:`popy_run`. To run a |popy| script :ref:`open_a_popy_command_prompt` and type:-

.. code-block:: console

    $ popy_run my_script.pyml
 
What happens with the script depends on its :ref:`type <script_formats>`. There are many script formats:-
      
* :ref:`fit<fit_script>` - Fit a model to data
* :ref:`gen<gen_script>` - Generate data from a model
* :ref:`sim<sim_script>` - Simulate |pkpd| curves
* :ref:`tut<tut_script>` - :ref:`gen<gen_script>` data and :ref:`fit<fit_script>` and compare the results
* :ref:`comp<comp_script>` - Compare :ref:`gen<gen_script>` and :ref:`fit<fit_script>` results
* :ref:`mfit<mfit_script>` - Fit a model to multiple data sets
* :ref:`mgen<mgen_script>` - Generate multiple data from a model
* :ref:`msim<sim_script>` - Simulate multiple |pkpd| curves
* :ref:`mtut<mtut_script>` - :ref:`mgen<mgen_script>` multiple data and :ref:`mfit<mfit_script>` and compare
* :ref:`mcomp<mcomp_script>` - Compare :ref:`mgen<mgen_script>` and :ref:`mfit<mfit_script>` results
* :ref:`grph<grph_script>` - Plot graphs
* :ref:`vpc<vpc_script>` - Plot |vpcs|
* :ref:`fitsum<fitsum_script>` - |html| summary of :ref:`fit<fit_script>` results
* :ref:`gensum<gensum_script>` - |html| summary of :ref:`gen<gen_script>` results
* :ref:`tutsum<tutsum_script>` - |html| summary of :ref:`tut<tut_script>` results
* :ref:`n2pdat<n2pdat_script>` - converts |nonmem| to |popy| data
* :ref:`p2ndat<p2ndat_script>` - converts |popy| to |nonmem| data
     
See :ref:`script_formats` for more information.

When :command:`popy_run` processes a script file, it creates a log file:-

.. code-block:: console

    my_script.pyml.run.main.log

as a record of the output. If a runtime error occurs during processing, a stack trace is sent to:-

.. code-block:: console

    my_script.pyml.run.error.log

as a record of what went wrong.
  
Command line options
--------------------
    
.. literalinclude:: /_autogen/tool_help/popy_run_help.inc
    :language: console 