##################################################
*PYSICA*: PYthon tools for SImulation and CAlculus
##################################################
.. contents::
Introduction
============
This package contains a collection of tools developed for some specific simulation and calculus tasks
in some fields of physics, including nonthermal plasma discharges, as well as surface modification and analysis.
The package was developed to fit my own needs, and it is released under the GNU GPL licence in the hope it can be helpful to someone else.
Of course, there are no warranties of any kind, as stated in the licence.
Installing and importing *pysica*
=================================
Distribution method
-------------------
Creating a specific package of *pysica* for each of the main Linux distributions (e.g. Debian, Red Hat, SUSE, and so on) would be too difficult
and time consuming, so I have decided to distribute it using the Python wheel system, that is distribution-independent.
Unfortunately, this installation method is concurrent with the specific one used by the Linux distribution (e.g. apt for Debian),
so many distributions allow to use it only inside a `Python virtual environment <https://docs.python.org/3/library/venv.html>`_,
to prevent the possibility of conflicts between packages installed by the different methods.
The procedure to create a virtual environment and install *pyisica* inside is described in the section
`How to install in a virtual Python environment`_ of this document. However, if you find uncomfortable to use a virtual environment,
you can also install the *pysica* package in a local directory of your choice,
as described in the section `How to install in a local directory`_.
.. note:: The package has been developed and tested in a Linux-based operative system.
Some subpackages could probably be used under other systems also,
but they have not been tested on them and there is no guarantee that they would work.
The modules have been compiled from Fortran as Linux executables: if you want to use them in another operating system you need to
recompile them using the *f2py* program and a Fortran compiler. The directories named *fortran* contain the Fortran source files,
the compiled modules and the scripts used for the compilation (the name of which always start with 'f2py'), but the options
used in the scripts to call *f2py* are specific for linux and the `gnu95 <https://gcc.gnu.org/fortran/>`_ Fortran compiler.
Dependencies
------------
This package depends heavily on `numpy <https://numpy.org/>`_ ,
while some specific modules and packages depend on `scipy <https://scipy.org/>`_ and `matplotlib <https://matplotlib.org/>`_ also.
Some packages make use of `tkinter <https://docs.python.org/3/library/tkinter.html>`_
and of the `gnuplot <http://www.gnuplot.info/>`_ progam, but they should work also without them,
although without some features.
How to install in the global Python environment
-----------------------------------------------
*pysica* is distribuited as a *Python wheel* so, if you have the program *pip* installed on your system
and the Linux distribution you are using allows you to do so, you can type at the teminal::
$ pip install pysica
in this way the Python interpreter will be able to use the *pysica* package regardless of the location from where it is invoked.
If *pip* is not installed on your system, you will have to install it following the specific method of the distribution you are using,
e.g. for Debian-related distibutions (including Ubuntu)::
$ sudo apt-get install pip
.. note:: In several Linux distributions (including Debian-related ones, like Ubuntu) the operative system does not allow *pip*
to install software in the main file hierarchy and
you will get an error message saying "externally managed environment" or something similar.
In this situation, you can install the package in a virtual Python environment, as described in the section
`How to install in a virtual Python environment`_, or in a local directory, as described in the
`How to install in a local directory`_ section.
How to install in a virtual Python environment
----------------------------------------------
Creating a *Python virtual environment* allows you to install *pysica* in distributions that do not allow *pip* to install Python packages
in the main filesystem. You can find detailed instructions on how to create and use a virtual environment
in `this page <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_ of the Python documentation.
In the following, a step-by-step description is provided of the procedure I would recommend to create a virtual environment
for a specific project and install *pysica* inside it.
- Open the terminal and move to the directory you want to use for your project, let's assume the directory name is *myproject*
- Decide a name for the virtual environment you are going to create, since you can create several environments in parallel.
Let's assume you have chosen the name *envpysica*.
- Create the environment using the following command at the Linux console::
$ python3 -m venv envpysica
this will create a new directory inside the *myproject* directory, named *envpysica*, inside which a copy of the Python system will be created.
- Now you have to activate the *envpysica* virtual environment by the following command::
$ source ./envpysica/bin/activate
or equivalently::
$ . ./envpysica/bin/activate
where the first dot is a short for the command *source*.
After the activation, the shell prompt should change in this way::
(envpysica) $
showing that you are using the *envpysica* environment.
While *envpysica* is activated, if you call the Python interpreter it will use the packages that are inside the *envpysica*
directory instead of the ones stored in the global filesystem. Moreover, if you install a Python package using the *pip*
program, it will be installed in that directory.
- You can now install the *pysica* package inside the *envpysica* environment, and its files will be stored in the *envpysica* directory
instead of in the global Linux file structure. To do this, type the following command at the terminal::
(envpysica) $ pip install pysica
the installation process should start and a progress bar should be showed in the terminal.
After the installation is completed, you can run the Python interpreter
and import the *pysica* module as described in the section `How to import`_.
- When you have finished working with *pysica*, you can exit from the *envpysica* environment by typing at the console the command::
(envpysica) $ deactivate
and the shell prompt should return the normal one.
Now, each time you want to use *pysica*, you have to enter the *envpysica* environment by moving to the *myproject* directory and running
the command::
$ . ./envpysica/bin/activate
and then run the Python interpreter.
How to install in a local directory
-----------------------------------
If your Linux distribution does not allow you to install the package in the global file structure,
and you do not want to use a virtual environment,
you can install *pysica* in any directory of your system by dowloading the most recent zip or tar.gz archive from the *pysica*
`GitHub page <https://github.com/pietromandracci/pysica/releases>`_ and unzipping it in a directory of your choice.
A new directory will be created, named *pysica-x.y.z*, where *x.y.z* identifies the version number.
In order to use *pysica*, you will have to and call the Python interpreter from this *pysica-x.y.z* directory,
so that it will be able to find the package files.
You can also use the package calling the Python intepreter from another directory,
but you have to create in that directory a symbolic link to the directory named *pysica*,
which is inside the *pysica-x.y.z* directory created during the zip archive extraction.
How to import
-------------
Once you have installed *pysica*, you can run the Python interpreter from the console::
$ python3
and then import *pysica* using the *import* directive as usual:
>>> import pysica
Or you can import a single mudule or package that you need, such as:
>>> from pysica.managers import gnuplot_manager
or
>>> from pysica.analysis import spectra
Documentation
=============
Documentation about the modules and packages is available in the docstrings, which can be accessed inside the Python interpreter
using the *help* function, after you have imported them. As an example, to read the docstring of the subpackage named *analysis* you can type::
>>> import pysica.analysis
>>> help(pysica.analysis)
or::
>>> from pysica import analysis
>>> help(analysis)
Note that, due to the Python importing mechanism, in order for the help function to work you must import the specific subpackage
on which you want help: e.g. if you import the main package *pysica*, the help fucntion will not work on the subpackage *pysica.analysis*.
For some packages, additional documentation can be found in the
`doc <https://github.com/pietromandracci/pysica/tree/master/doc>`_ directory of the *GitHub* repository. In this case,
a direct link to the documentation is given in the corresponding paragraph of the section `Package structure`_.
Package structure
=================
In the following, the main modules and subpackages are listed.
constants (module)
------------------
Contains some physical constants used in various modules and packages.
parameters (module)
-------------------
Contains some parameters used in various modules and packages.
analysis (package)
------------------
Contains some modules to manage distribution functions and data histograms.
*univariate (module)*
tools for the statistical analysis of univariate samples;
*bivariate (module)*
tools for the statistical analysis of bivariate samples;
*spectra (module)*
tools for the analysis of different types of spectra, whith a special focus on
- optical data (e.g. transmission spectra) of thin films;
- surface morphology data (e.g. surface roughness analysis).
functions (package)
-------------------
Contains some general purpose functions.
*fortran (package)*
some general purpose functions, compiled from Fortran using f2py,
they are collected in the *fmathematics* module;
*mathematics (module)*
some general purpose mathematical funtions;
*statistics (module)*
some generic statistics functions;
*pdf (module)*
some probabilty distribution functions (pdf);
*random_pdf (module)*
functions useful to generate random numbers following specific pdfs;
*physics (module)*
some general purpose funcions used in generic physics applications;
*optics (module)*
some functions useful for optical applications.
managers (package)
------------------
Contains some modules and packages used to manage input/output of data from/to ascii files,
to print physical quantities managing the unit prefixes, and to plot data by means of the *gnuplot* program.
*io (package)*
some modules used for generic input-output management;
*data_manager (module)*
tools to manage data reading and writing from files;
*unit_manager (module)*
tools to manage the output of numerical data with automatic managment of unit prefixies;
*gnuplot_manager (package)*
a package to facilitate the use of gnuplot inside Python [#gnuplot_manager]_.
.. [#gnuplot_manager] This package is also available as a standalone package (without the rest of *pysica*) on
`its own GitHub page <https://github.com/pietromandracci/gnuplot_manager>`_,
where you can find extensive documentation about it.
plasma (package)
-------------------
A package containing tools for the simulation of plasma discharges.
*ccpla (package)*
a package containing scripts, modules, and subpackages used to simulate low pressure capacitively coupled discharges.
Documentation about this package is given `here <https://github.com/pietromandracci/pysica/tree/master/doc/ccpla/ccpla_manual.rst>`_.
Raw data
{
"_id": null,
"home_page": "https://github.com/pietromandracci/pysica",
"name": "pysica",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": null,
"author": "Pietro Mandracci",
"author_email": "pietro.mandracci.software@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/31/b9/3e23d2cee10b5c5fb5ff2d471f3049f6298adb40e36fffa6bd1aa8c0a092/pysica-0.4.3.tar.gz",
"platform": null,
"description": "\n##################################################\n*PYSICA*: PYthon tools for SImulation and CAlculus\n##################################################\n\n.. contents::\n\nIntroduction\n============\n\nThis package contains a collection of tools developed for some specific simulation and calculus tasks\nin some fields of physics, including nonthermal plasma discharges, as well as surface modification and analysis.\nThe package was developed to fit my own needs, and it is released under the GNU GPL licence in the hope it can be helpful to someone else.\nOf course, there are no warranties of any kind, as stated in the licence.\n\nInstalling and importing *pysica*\n=================================\n\nDistribution method\n-------------------\n\nCreating a specific package of *pysica* for each of the main Linux distributions (e.g. Debian, Red Hat, SUSE, and so on) would be too difficult\nand time consuming, so I have decided to distribute it using the Python wheel system, that is distribution-independent.\nUnfortunately, this installation method is concurrent with the specific one used by the Linux distribution (e.g. apt for Debian),\nso many distributions allow to use it only inside a `Python virtual environment <https://docs.python.org/3/library/venv.html>`_,\nto prevent the possibility of conflicts between packages installed by the different methods.\nThe procedure to create a virtual environment and install *pyisica* inside is described in the section\n`How to install in a virtual Python environment`_ of this document. However, if you find uncomfortable to use a virtual environment,\nyou can also install the *pysica* package in a local directory of your choice,\nas described in the section `How to install in a local directory`_.\n\n.. note:: The package has been developed and tested in a Linux-based operative system.\n Some subpackages could probably be used under other systems also,\n but they have not been tested on them and there is no guarantee that they would work.\n The modules have been compiled from Fortran as Linux executables: if you want to use them in another operating system you need to\n recompile them using the *f2py* program and a Fortran compiler. The directories named *fortran* contain the Fortran source files,\n the compiled modules and the scripts used for the compilation (the name of which always start with 'f2py'), but the options\n used in the scripts to call *f2py* are specific for linux and the `gnu95 <https://gcc.gnu.org/fortran/>`_ Fortran compiler. \n\n\nDependencies\n------------\n\nThis package depends heavily on `numpy <https://numpy.org/>`_ ,\nwhile some specific modules and packages depend on `scipy <https://scipy.org/>`_ and `matplotlib <https://matplotlib.org/>`_ also.\nSome packages make use of `tkinter <https://docs.python.org/3/library/tkinter.html>`_\nand of the `gnuplot <http://www.gnuplot.info/>`_ progam, but they should work also without them,\nalthough without some features. \n\n\n\n \nHow to install in the global Python environment\n-----------------------------------------------\n\n*pysica* is distribuited as a *Python wheel* so, if you have the program *pip* installed on your system\nand the Linux distribution you are using allows you to do so, you can type at the teminal::\n\n$ pip install pysica\n\nin this way the Python interpreter will be able to use the *pysica* package regardless of the location from where it is invoked.\nIf *pip* is not installed on your system, you will have to install it following the specific method of the distribution you are using,\ne.g. for Debian-related distibutions (including Ubuntu)::\n\n $ sudo apt-get install pip\n\n.. note:: In several Linux distributions (including Debian-related ones, like Ubuntu) the operative system does not allow *pip*\n to install software in the main file hierarchy and\n you will get an error message saying \"externally managed environment\" or something similar.\n In this situation, you can install the package in a virtual Python environment, as described in the section\n `How to install in a virtual Python environment`_, or in a local directory, as described in the\n `How to install in a local directory`_ section.\n\n\nHow to install in a virtual Python environment\n----------------------------------------------\n\nCreating a *Python virtual environment* allows you to install *pysica* in distributions that do not allow *pip* to install Python packages\nin the main filesystem. You can find detailed instructions on how to create and use a virtual environment\nin `this page <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_ of the Python documentation.\nIn the following, a step-by-step description is provided of the procedure I would recommend to create a virtual environment\nfor a specific project and install *pysica* inside it.\n\n- Open the terminal and move to the directory you want to use for your project, let's assume the directory name is *myproject*\n\n- Decide a name for the virtual environment you are going to create, since you can create several environments in parallel.\n Let's assume you have chosen the name *envpysica*.\n \n- Create the environment using the following command at the Linux console::\n\n $ python3 -m venv envpysica\n\n this will create a new directory inside the *myproject* directory, named *envpysica*, inside which a copy of the Python system will be created.\n\n- Now you have to activate the *envpysica* virtual environment by the following command::\n \n $ source ./envpysica/bin/activate\n\n or equivalently::\n\n $ . ./envpysica/bin/activate\n\n where the first dot is a short for the command *source*.\n \n After the activation, the shell prompt should change in this way::\n\n (envpysica) $\n\n showing that you are using the *envpysica* environment.\n While *envpysica* is activated, if you call the Python interpreter it will use the packages that are inside the *envpysica*\n directory instead of the ones stored in the global filesystem. Moreover, if you install a Python package using the *pip*\n program, it will be installed in that directory.\n \n- You can now install the *pysica* package inside the *envpysica* environment, and its files will be stored in the *envpysica* directory\n instead of in the global Linux file structure. To do this, type the following command at the terminal::\n\n (envpysica) $ pip install pysica\n\n the installation process should start and a progress bar should be showed in the terminal. \n After the installation is completed, you can run the Python interpreter \n and import the *pysica* module as described in the section `How to import`_.\n\n- When you have finished working with *pysica*, you can exit from the *envpysica* environment by typing at the console the command::\n\n (envpysica) $ deactivate\n\n and the shell prompt should return the normal one.\n\nNow, each time you want to use *pysica*, you have to enter the *envpysica* environment by moving to the *myproject* directory and running\nthe command::\n \n $ . ./envpysica/bin/activate\n\nand then run the Python interpreter.\n \n\nHow to install in a local directory\n-----------------------------------\n\nIf your Linux distribution does not allow you to install the package in the global file structure,\nand you do not want to use a virtual environment,\nyou can install *pysica* in any directory of your system by dowloading the most recent zip or tar.gz archive from the *pysica* \n`GitHub page <https://github.com/pietromandracci/pysica/releases>`_ and unzipping it in a directory of your choice.\n\nA new directory will be created, named *pysica-x.y.z*, where *x.y.z* identifies the version number. \nIn order to use *pysica*, you will have to and call the Python interpreter from this *pysica-x.y.z* directory,\nso that it will be able to find the package files. \n\nYou can also use the package calling the Python intepreter from another directory,\nbut you have to create in that directory a symbolic link to the directory named *pysica*,\nwhich is inside the *pysica-x.y.z* directory created during the zip archive extraction.\n \n\nHow to import\n-------------\n\nOnce you have installed *pysica*, you can run the Python interpreter from the console::\n\n$ python3\n\nand then import *pysica* using the *import* directive as usual:\n\n>>> import pysica\n\nOr you can import a single mudule or package that you need, such as:\n\n>>> from pysica.managers import gnuplot_manager\n\nor\n\n>>> from pysica.analysis import spectra\n\n\n\nDocumentation\n=============\n\nDocumentation about the modules and packages is available in the docstrings, which can be accessed inside the Python interpreter\nusing the *help* function, after you have imported them. As an example, to read the docstring of the subpackage named *analysis* you can type::\n\n >>> import pysica.analysis\n >>> help(pysica.analysis)\n\nor::\n\n >>> from pysica import analysis\n >>> help(analysis)\n\nNote that, due to the Python importing mechanism, in order for the help function to work you must import the specific subpackage \non which you want help: e.g. if you import the main package *pysica*, the help fucntion will not work on the subpackage *pysica.analysis*.\n\nFor some packages, additional documentation can be found in the\n`doc <https://github.com/pietromandracci/pysica/tree/master/doc>`_ directory of the *GitHub* repository. In this case,\na direct link to the documentation is given in the corresponding paragraph of the section `Package structure`_.\n\n\n\nPackage structure\n=================\n\nIn the following, the main modules and subpackages are listed.\n\n\nconstants (module)\n------------------\n\nContains some physical constants used in various modules and packages.\n\n\nparameters (module)\n-------------------\n\nContains some parameters used in various modules and packages.\n\n \nanalysis (package)\n------------------\n\nContains some modules to manage distribution functions and data histograms.\n\n*univariate (module)*\n tools for the statistical analysis of univariate samples;\n\n*bivariate (module)*\n tools for the statistical analysis of bivariate samples;\n\n*spectra (module)*\n tools for the analysis of different types of spectra, whith a special focus on\n - optical data (e.g. transmission spectra) of thin films;\n - surface morphology data (e.g. surface roughness analysis).\n\n\n \nfunctions (package)\n-------------------\n\nContains some general purpose functions.\n\n*fortran (package)*\n some general purpose functions, compiled from Fortran using f2py,\n they are collected in the *fmathematics* module;\n\n*mathematics (module)*\n some general purpose mathematical funtions;\n\n*statistics (module)*\n some generic statistics functions;\n\n*pdf (module)*\n some probabilty distribution functions (pdf);\n\n*random_pdf (module)*\n functions useful to generate random numbers following specific pdfs;\n \n*physics (module)*\n some general purpose funcions used in generic physics applications;\n \n*optics (module)*\n some functions useful for optical applications.\n\n\nmanagers (package)\n------------------\n\nContains some modules and packages used to manage input/output of data from/to ascii files,\nto print physical quantities managing the unit prefixes, and to plot data by means of the *gnuplot* program.\n\n*io (package)*\n some modules used for generic input-output management;\n\n*data_manager (module)*\n tools to manage data reading and writing from files;\n\n*unit_manager (module)*\n tools to manage the output of numerical data with automatic managment of unit prefixies;\n\n*gnuplot_manager (package)*\n a package to facilitate the use of gnuplot inside Python [#gnuplot_manager]_.\n\n \n.. [#gnuplot_manager] This package is also available as a standalone package (without the rest of *pysica*) on\n `its own GitHub page <https://github.com/pietromandracci/gnuplot_manager>`_,\n where you can find extensive documentation about it.\n \n\n\nplasma (package)\n-------------------\n\nA package containing tools for the simulation of plasma discharges.\n\n*ccpla (package)*\n a package containing scripts, modules, and subpackages used to simulate low pressure capacitively coupled discharges.\n Documentation about this package is given `here <https://github.com/pietromandracci/pysica/tree/master/doc/ccpla/ccpla_manual.rst>`_. \n\n \n\n",
"bugtrack_url": null,
"license": null,
"summary": "PYthon tools for SImulation and CAlculus",
"version": "0.4.3",
"project_urls": {
"Homepage": "https://github.com/pietromandracci/pysica"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a0acb9450aa3087d0a81911c65ad51b1fc63a04efe7a63e4fdaed8e13d9100f5",
"md5": "b90cd1d566b8997a6748d68a82f0880b",
"sha256": "17ecde710a0847d50e6b0a961b6967c76f0d8b7f0882ab6cddf09b1ad9fc5d8b"
},
"downloads": -1,
"filename": "pysica-0.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b90cd1d566b8997a6748d68a82f0880b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 290146,
"upload_time": "2024-08-22T16:23:07",
"upload_time_iso_8601": "2024-08-22T16:23:07.775138Z",
"url": "https://files.pythonhosted.org/packages/a0/ac/b9450aa3087d0a81911c65ad51b1fc63a04efe7a63e4fdaed8e13d9100f5/pysica-0.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "31b93e23d2cee10b5c5fb5ff2d471f3049f6298adb40e36fffa6bd1aa8c0a092",
"md5": "2ec33360293ee6832f1b3b2b0715a32c",
"sha256": "ab419a00b7a1d93bc11ef1a3511b52b1bda7b38ad96eb043dbc0e0d67cee40cb"
},
"downloads": -1,
"filename": "pysica-0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "2ec33360293ee6832f1b3b2b0715a32c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 169858,
"upload_time": "2024-08-22T16:23:10",
"upload_time_iso_8601": "2024-08-22T16:23:10.544781Z",
"url": "https://files.pythonhosted.org/packages/31/b9/3e23d2cee10b5c5fb5ff2d471f3049f6298adb40e36fffa6bd1aa8c0a092/pysica-0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-22 16:23:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pietromandracci",
"github_project": "pysica",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pysica"
}