semvec/pypi-packages huggingface dataset:
topas2numpy 0.2.0
Python functions for reading TOPAS result files
License: MIT
Keywords: topas2numpy,topas

===============================
topas2numpy
===============================

|pypi| |travis-ci| |coveralls| |readthedocs|

Reading TOPAS_ results into NumPy_ arrays.



Features
--------

TOPAS_ is a Monte Carlo tool for particle simulation, designed for medical physics research. It can output two data types:

- **binned**: a quantity (e.g. dose) is accumulated within a binned geometry component
- **ntuple**: multiple data columns are recorded per particle history

This package is able to read both data types, enabling analysis within Python.



Basic Usage
-----------

.. code-block:: python

    from topas2numpy import BinnedResult
    x = BinnedResult('Dose.csv')

    from topas2numpy import read_ntuple
    y = read_ntuple('Beam.phsp')



.. _TOPAS: http://www.topasmc.org
.. _NumPy: http://www.numpy.org


.. |pypi| image:: https://img.shields.io/pypi/v/topas2numpy.svg
        :target: https://pypi.python.org/pypi/topas2numpy
        :alt: PyPI Package

.. |travis-ci| image:: https://img.shields.io/travis/davidchall/topas2numpy.svg
        :target: https://travis-ci.org/davidchall/topas2numpy
        :alt: Build Status

.. |coveralls| image:: https://coveralls.io/repos/github/davidchall/topas2numpy/badge.svg?branch=master
        :target: https://coveralls.io/github/davidchall/topas2numpy?branch=master
        :alt: Code Coverage

.. |readthedocs| image:: http://readthedocs.org/projects/topas2numpy/badge/?version=latest
        :target: http://topas2numpy.readthedocs.org/en/latest/?badge=latest
        :alt: Documentation Status


=======
History
=======

0.1.2 (2016-02-23)
------------------

* Support upcoming binary ntuple headers
* Support additional integer columns in old-style binary phasespaces


0.1.0 (2016-02-19)
------------------

* First release on PyPI
django-rszio 1.1.0
Django wrapper for RSZ.IO
License: MIT
Keywords: django resize image

django-rszio
============

A Django wrapper for https://rsz.io

Installation
------------

Install via pip:

::

    pip install django-rszio

Usage
-----

1. Add to ``INSTALLED_APPS`` in ``settings.py`` ``'rszio',``
2. Add the include to urlpatterns in ``urls.py``
   ``urlpatterns = [ url(r'^media/', include('rszio.urls')), ]``
3. Load the template tag into a template ``{% load rszio %}``
4. Use the ``image`` tag.
   ``{% image 'path/to/image.jpg' width=100 rotate=10 %}`` Visit the
   `RSZ.IO Docs <https://rsz.io/#docs>`__ for all of the options.
   Convert parameters to kwargs.

Options
-------

Prevalidate if the image exists in the default file storage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add to ``settings.py``

::

    RSZIO_CHECK_EXISTS = True

The default is ``False``

Cache Control headers
~~~~~~~~~~~~~~~~~~~~~

It is highly recommended that if you use this package your site should
be sitting behind a CDN. Not sure what this is, check out
https://www.cloudflare.com/

Add to ``settings.py``

To set an expiration timeout use an integer in seconds. For example,
below the image is set to cache for an hour.

::

    RSZIO_CACHE_CONTROL = 3600

This will output ``Cache-Control max-age=3600`` in the response header.

**The advanced option**

Any string you pass that doesn't convert to an int will be set in the
header.

::

    RSZIO_CACHE_CONTROL = "no-cache"

This will output ``Cache-Control no-cache`` in the response header.

Caveats
-------

-  `KISS <https://en.wikipedia.org/wiki/KISS_principle>`__
-  The origional image must be accessable via a URL, so RSZ.IO can
   access it. I use
   `django-storages <https://django-storages.readthedocs.io/en/latest/>`__
   with AWS S3 to serve my media.
-  This is tested and used in production with Django 1.10 and 1.11 on
   Python 3.5 and 3.6. But this should work on older versions of Django
   and Python 2. Open an issue or pull request if not the case.

Versioning
----------

The package is following the Major.Minor.BugFix philosophy. So breaking
changes will increase the major number. New features will increase the
minor number.

So it is safe to put this line in your ``requirements.txt``

**All new features, no breaking features**

::

    django-rszio>=1.0.0,<2.0

**Just bugfixes**

::

    django-rszio>=1.0.0,<1.1