Skip to content

Commit

Permalink
v0.0.1.3
Browse files Browse the repository at this point in the history
Better xlim
fix doc encoding bug in pypi
  • Loading branch information
Python-simulation committed Jan 25, 2020
1 parent 6268611 commit dd59551
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 106 deletions.
2 changes: 1 addition & 1 deletion beampy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# module
from beampy import examples

__version__ = "0.0.1.2"
__version__ = "0.0.1.3"


def help():
Expand Down
4 changes: 3 additions & 1 deletion beampy/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
The bpm codes are mainly based on a compilation of MatLab codes initialy
developed by Régis Grasser during his PhD thesis[2],
and later modified at the LMOPS laboratory[3].
and later modified at the FEMTO-ST institute of the Université de
Franche-Comté and at the LMOPS laboratory [3] of the
Université de Lorraine.
[1] K. Okamoto, in Fundamentals of Optical Waveguides,
2nd ed., edited by K. Okamoto (Academic, Burlington, 2006), pp. 329–397.
Expand Down
62 changes: 20 additions & 42 deletions beampy/user_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,22 @@ def addmpl(self, tab='guide', pow_index=0):
if pow_index < 0:
pow_index_guide -= 1 # Display the -2 guide for the -1 beam

x_min = self.x[0]
x_max = self.x[-1]

if (self.topology == 'array' # If array of guides
and self.nbr_p != 0 and self.p != 0 # If guides exists
and self.peaks[0, 0] >= self.x[0] # If guides in the windows
and self.peaks[-1, -1] <= self.x[-1]):
x_min = self.offset_guide - self.nbr_p*self.p
x_max = self.offset_guide + self.nbr_p*self.p

if (self.topology == 'curved' # If curved guides
and self.peaks[0, 0] >= self.x[0] # If guides in the windows
and self.peaks[-1, -1] <= self.x[-1]):
x_min = self.peaks[0, 0] - self.width
x_max = self.peaks[-1, -1] + self.width

if tab == 'guide':
fig = Figure()
fig.set_tight_layout(True) # Prevent axes to be cut when resizing
Expand All @@ -485,16 +501,7 @@ def addmpl(self, tab='guide', pow_index=0):
ax1.set_xlabel('x (µm)')
ax1.set_ylabel('z (mm)')

if self.nbr_p != 0 and self.p != 0 and self.topology != 'curved':
x_min = self.offset_guide - self.nbr_p*self.p
if x_min < self.x[0]:
x_min = self.x[0]

x_max = self.offset_guide + self.nbr_p*self.p
if x_max > self.x[-1]:
x_max = self.x[-1]

ax1.set_xlim(x_min, x_max)
ax1.set_xlim(x_min, x_max)

# note that a colormesh pixel is based on 4 points
ax1.pcolormesh(self.xv,
Expand Down Expand Up @@ -524,16 +531,7 @@ def addmpl(self, tab='guide', pow_index=0):
poly = Polygon(verts, facecolor='0.9', edgecolor='0.5')
ax2.add_patch(poly)

if self.p != 0 and self.topology != 'curved':
x_min = self.offset_guide - self.nbr_p*self.p
if x_min < self.x[0]:
x_min = self.x[0]

x_max = self.offset_guide + self.nbr_p*self.p
if x_max > self.x[-1]:
x_max = self.x[-1]

ax2.set_xlim(x_min, x_max)
ax2.set_xlim(x_min, x_max)

ax2.set_ylim(0,
max(self.dn[0, :])*1.1 + 1E-20)
Expand Down Expand Up @@ -572,16 +570,7 @@ def addmpl(self, tab='guide', pow_index=0):
poly = Polygon(verts, facecolor='0.9', edgecolor='0.5')
ax1.add_patch(poly)

if self.p != 0 and self.topology != 'curved':
x_min = self.offset_guide - self.nbr_p*self.p
if x_min < self.x[0]:
x_min = self.x[0]

x_max = self.offset_guide + self.nbr_p*self.p
if x_max > self.x[-1]:
x_max = self.x[-1]

ax1.set_xlim(x_min, x_max)
ax1.set_xlim(x_min, x_max)

ax1.set_ylim(0,
max(1.1*self.dn[pow_index_guide, :]) + 1E-20)
Expand Down Expand Up @@ -621,18 +610,7 @@ def addmpl(self, tab='guide', pow_index=0):
ax1.set_xlabel('x (µm)')
ax1.set_ylabel('z (mm)')

if (self.nbr_p != 0 and self.p != 0
and self.topology != 'curved'):

x_min = self.offset_guide - self.nbr_p*self.p
if x_min < self.x[0]:
x_min = self.x[0]

x_max = self.offset_guide + self.nbr_p*self.p
if x_max > self.x[-1]:
x_max = self.x[-1]

ax1.set_xlim(x_min, x_max)
ax2.set_xlim(x_min, x_max)

ax1.pcolormesh(self.xv,
self.zv,
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# sphinx-build -b html . html
# sphinx-build -M latexpdf . latexpdf

# When uploading the online version, wipe the project cache at readthedocs
# before or will fail compiling pip
# -- Project information -----------------------------------------------------

project = 'beampy'
Expand Down
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8116325f5fcdc414db89fc5ae6481eaf
config: 0d720dd1f008c44a89fa7d947d94833c
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/html/.doctrees/beampy.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/codes.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/html/.doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/LICENSE.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>MIT License &mdash; beampy 0.0.1.2 documentation</title>
<title>MIT License &mdash; beampy 0.0.1.3 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.0.1.2',
VERSION: '0.0.1.3',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
8 changes: 5 additions & 3 deletions docs/html/beampy.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Beampy modules &mdash; beampy 0.0.1.2 documentation</title>
<title>Beampy modules &mdash; beampy 0.0.1.3 documentation</title>



Expand Down Expand Up @@ -160,7 +160,7 @@

<div class="section" id="beampy-modules">
<h1>Beampy modules<a class="headerlink" href="#beampy-modules" title="Permalink to this headline"></a></h1>
<p>List of all the modules used in Beampy as of Jan 22, 2020 for the version 0.0.1.2</p>
<p>List of all the modules used in Beampy as of Jan 25, 2020 for the version 0.0.1.3</p>
<p><a class="reference internal" href="codes.html#codes"><span class="std std-ref">Source codes</span></a></p>
<div class="section" id="beampy-bpm">
<h2>beampy.bpm<a class="headerlink" href="#beampy-bpm" title="Permalink to this headline"></a></h2>
Expand All @@ -174,7 +174,9 @@ <h2>beampy.bpm<a class="headerlink" href="#beampy-bpm" title="Permalink to this
under the directive of Pr. Nicolas Fressengeas.</p>
<p>The bpm codes are mainly based on a compilation of MatLab codes initialy
developed by Régis Grasser during his PhD thesis[2],
and later modified at the LMOPS laboratory[3].</p>
and later modified at the FEMTO-ST institute of the Université de
Franche-Comté and at the LMOPS laboratory [3] of the
Université de Lorraine.</p>
<p>[1] K. Okamoto, in Fundamentals of Optical Waveguides,
2nd ed., edited by K. Okamoto (Academic, Burlington, 2006), pp. 329–397.</p>
<p>[2] “Generation et propagation de reseaux periodiques de solitons spatiaux
Expand Down

0 comments on commit dd59551

Please sign in to comment.