Skip to content

betatim/xml2jupyter

 
 

Repository files navigation

xml2jupyter

Using an XML configuration file, generate a graphical user interface (GUI) consisting of Jupyter widgets. This project is primarily in support of the PhysiCell simulator and its configuration files, however, the basic idea can be extended to other text-based configuration files.

The xml2jupyter.py Python script provides the core functionality for dynamically creating widgets from XML. The other Python scripts are static and provide a self-contained Jupyter GUI consisting of multiple tabs. Again, the overall GUI is written for the PhysiCell simulator - two tabs provide widgets for input parameters and two tabs allow visualization of data generated by PhysiCell.

Dependencies

  1. Minimally, this project just requires Python (we recommend Python 3.x). A standard distribution of Python will let you convert sample XML configuration files into Jupyter widgets.
  2. If you install Jupyter, you will be able to display the widgets in a notebook (in your web browser) and modify the XML via the widgets.
  3. If you install some additional Python modules (matplotlib and scipy), not available in the standard library, you will be able to display a GUI notebook for PhysiCell.

We recommend installing the Anaconda Python 3.x distribution to provide all dependencies. However, an alternative, requiring less disk space, is to install Miniconda Python 3.x and then:

conda install matplotlib
conda install scipy
conda install jupyter

Sample Usage

From the root directory of xml2jupyter (we demonstrate using Unix-style shell commands):

$ cp config_samples/config_biorobots.xml .
$ python xml2jupyter.py config_biorobots.xml test_user_params.py 
$ jupyter notebook test_gui.ipynb

When the notebook starts in your browser, in the "Cell" menu, click "Run All". This should display the minimal notebook that will let you update your XML after changing values in widgets and cicking the 'Write' button.

alt text

Contributions

We welcome users' feedback and contributions. Please use the Issues feature for comments related to this repository and project.

For questions related to PhysiCell, please join us at https://groups.google.com/forum/#!forum/physicell-users.

About

Generate Jupyter widgets (and a notebook) from an XML configuration file [for PhysiCell]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 87.1%
  • TeX 7.1%
  • Jupyter Notebook 3.3%
  • Makefile 2.3%
  • Shell 0.2%