Metadata-Version: 2.4
Name: FiberFusing
Version: 1.9.7
Summary: Parametrized fused-fiber cross-sections and refractive-index meshes.
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
License: MIT License
        
        Copyright (c) 2020 Martin de Sivry
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/MartinPdeS/FiberFusing
Project-URL: Documentation, https://martinpdes.github.io/FiberFusing/
Project-URL: Repository, https://github.com/MartinPdeS/FiberFusing.git
Keywords: fiber,fusing
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pyyaml
Requires-Dist: typing_extensions>=4.4
Requires-Dist: pydantic<3,>=2
Requires-Dist: scipy
Requires-Dist: matplotlib<4,>=3.8
Requires-Dist: numpy
Requires-Dist: shapely>=2.0
Provides-Extra: release
Requires-Dist: martinpdes-maintenance==0.2.2; extra == "release"
Provides-Extra: dev
Requires-Dist: ruff==0.17.2; extra == "dev"
Requires-Dist: build<2,>=1; extra == "dev"
Requires-Dist: twine<7,>=6; extra == "dev"
Provides-Extra: testing
Requires-Dist: tomli>=2; python_version < "3.11" and extra == "testing"
Requires-Dist: pytest<10.0,>=7.4; extra == "testing"
Requires-Dist: pytest-cov<7,>=2; extra == "testing"
Requires-Dist: pytest-json-report~=1.5; extra == "testing"
Requires-Dist: flake8==7.3.0; extra == "testing"
Requires-Dist: coverage~=7.6; extra == "testing"
Provides-Extra: documentation
Requires-Dist: MartinPdeS-docs<0.4,>=0.3.2; extra == "documentation"
Dynamic: license-file

|logo|

.. list-table::
   :widths: 35 65
   :header-rows: 1

   * - Badge
     - Status
   * - Python versions
     - |python|
   * - Documentation
     - |docs|
   * - Continuous integration
     - |ci/cd|
   * - Test coverage
     - |coverage|
   * - Google Colab
     - |colab|
   * - PyPI package
     - |PyPi|
   * - PyPI downloads
     - |PyPi_download|
   * - Anaconda package
     - |anaconda|
   * - Anaconda downloads
     - |anaconda_download|

FiberFusing
===========

**FiberFusing** is an open-source Python package for parametrized fused-fiber
cross-sections and refractive-index meshes. Define a fiber arrangement, adjust
its fusion degree, and combine the resulting profile with optical fibers and a
background medium.

Features
--------

- Circular and linear fiber arrangements with adjustable fusion degree.
- Geometric connection optimization with area-conservation diagnostics.
- Fiber catalog loading and refractive-index mesh generation.
- Core-position perturbations with reproducible random seeds.
- Matplotlib plots with supplied-axes support and headless rendering.

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

Install from PyPI using the Python interpreter for your simulations:

.. code-block:: bash

   python -m pip install FiberFusing

Alternatively, install from the MartinPdeS Anaconda channel:

.. code-block:: bash

   conda install -c MartinPdeS fiberfusing

Verify the installation with:

.. code-block:: bash

   python -c "import FiberFusing; print(FiberFusing.__version__)"

Python compatibility
--------------------

FiberFusing supports **Python 3.10, 3.11, 3.12, 3.13, and 3.14**. The full test
suite runs on all five versions in
`GitHub Actions <https://github.com/MartinPdeS/FiberFusing/actions/workflows/tests.yml>`_.

The package contains pure Python code. Its universal wheel and Conda ``noarch``
package can be installed on these Python versions without compiling FiberFusing.
Release artifacts are currently built and installation-checked on Python 3.11;
source tests also run on Python 3.13 and 3.14.

First simulation
----------------

Build a circular arrangement of three fibers with a cladding radius of
62.5 micrometers. Lengths in this example use meters; refractive indices are
dimensionless.

.. code-block:: python

   from FiberFusing import Geometry, DomainAlignment, BackGround
   from FiberFusing.fiber import FiberLoader
   from FiberFusing.profile import Profile, StructureType

   air_background = BackGround(refractive_index=1.0)

   profile = Profile()

   profile.add_structure(
      structure_type=StructureType.CIRCULAR,
      number_of_fibers=3,
      fusion_degree=0.4,
      fiber_radius=62.5e-6
   )

   profile.refractive_index = 1.4444

   fiber_loader = FiberLoader()
   fibers = [
      fiber_loader.load_fiber('SMF28', clad_refractive_index=profile.refractive_index, position=core_position)
      for core_position in profile.cores
   ]

   geometry = Geometry(
      x_bounds=DomainAlignment.CENTERING,
      y_bounds=DomainAlignment.CENTERING,
      resolution=350
   )

   geometry.add_structure(air_background, profile, *fibers)

   geometry.initialize()

   geometry.plot()

|example_3x3|

For headless workflows, use ``geometry.plot(show=False)`` to obtain a Matplotlib
figure without opening a window. See the
`plotting guide <https://martinpdes.github.io/FiberFusing/docs/latest/plotting.html>`_
for supplied axes, styling, and export options.

Documentation and examples
--------------------------

See the `online documentation
<https://martinpdes.github.io/FiberFusing/docs/latest/>`_ for the API and
numerical behavior, and the `example gallery
<https://martinpdes.github.io/FiberFusing/docs/latest/gallery/index.html>`_
for runnable fiber configurations.

Developer setup
---------------

Clone the repository, select Python 3.10 or newer, and install the development
and testing dependencies:

.. code-block:: bash

   git clone https://github.com/MartinPdeS/FiberFusing.git
   cd FiberFusing
   python -m pip install -e ".[testing,dev,release]"

Run checks with the same interpreter:

.. code-block:: bash

   MPLBACKEND=Agg python -m pytest
   python -m ruff check FiberFusing tests
   make release-check PYTHON=python

See ``CONTRIBUTING.md`` for documentation builds, installed-package checks, and
release commands. Versions are explicit and releases use the shared
``martinpdes-maintenance`` tool.

Contact
-------

For questions or contributions, open an issue on
`GitHub <https://github.com/MartinPdeS/FiberFusing/issues>`_ or contact
`Martin Poinsinet de Sivry-Houle
<mailto:martin.poinsinet-de-sivry@polymtl.ca?subject=FiberFusing>`_.

.. |python| image:: https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue
   :target: https://github.com/MartinPdeS/FiberFusing/actions/workflows/tests.yml
   :alt: Supported and tested Python versions: 3.10, 3.11, 3.12, 3.13, 3.14

.. |PyPi| image:: https://badge.fury.io/py/FiberFusing.svg
   :target: https://pypi.org/project/FiberFusing/
   :alt: PyPi

.. |PyPi_download| image:: https://img.shields.io/pypi/dm/fiberfusing.svg
   :target: https://pypistats.org/packages/fiberfusing
   :alt: PyPi download statistics

.. |logo| image:: https://github.com/MartinPdeS/FiberFusing/raw/master/docs/images/logo.png
   :alt: FiberFusing navy and coral seven-core logo
   :width: 720px

.. |docs| image:: https://github.com/martinpdes/fiberfusing/actions/workflows/deploy_documentation.yml/badge.svg
   :target: https://martinpdes.github.io/FiberFusing/
   :alt: Documentation Status

.. |coverage| image:: https://raw.githubusercontent.com/MartinPdeS/FiberFusing/python-coverage-comment-action-data/badge.svg
   :target: https://htmlpreview.github.io/?https://github.com/MartinPdeS/FiberFusing/blob/python-coverage-comment-action-data/htmlcov/index.html
   :alt: Unittest coverage

.. |ci/cd| image:: https://github.com/martinpdes/fiberfusing/actions/workflows/tests.yml/badge.svg
   :target: https://github.com/MartinPdeS/FiberFusing/actions
   :alt: Unittest Status

.. |anaconda_download| image:: https://anaconda.org/martinpdes/fiberfusing/badges/downloads.svg
   :alt: Anaconda downloads
   :target: https://anaconda.org/martinpdes/fiberfusing

.. |anaconda| image:: https://anaconda.org/martinpdes/fiberfusing/badges/version.svg
   :alt: Anaconda version
   :target: https://anaconda.org/martinpdes/fiberfusing

.. |example_3x3| image:: https://github.com/MartinPdeS/FiberFusing/raw/master/docs/images/example_3x3.png
   :alt: Three-fiber fused cross-section and refractive-index mesh

.. |colab| image:: https://colab.research.google.com/assets/colab-badge.svg
   :target: https://colab.research.google.com/github/MartinPdeS/FiberFusing/blob/master/notebook.ipynb
