Releases: scottprahl/laserbeamsize
Releases · scottprahl/laserbeamsize
fix bug in M² fitting under strict
2.4.1 (2026-03-16)
- fix M2_fit() strict-mode trimming so focal-zone points are not discarded
- fix set_zero_to_lightgray() IndexError when zero lies at the top of the display range
- fix M2_diameter_plot() minor-axis residual ISO spans to use the minor-axis fit limits
- fix mypy annotations in human_test_for_phi_fixed.py
- eliminate spurious OptimizeWarning from strict-mode M² regression tests
Fit and finish release
No new functionality but better fit and finish.
2.4.0 (2026-03-15)
- fix plot_beam_diagram() used d_major for minor-rectangle dimension
- fix plot_image_analysis() minor-axis label compared major-axis variables
- fix beam_size() crash when d_minor becomes None during iterative refinement
- fix NaN propagation in basic_beam_fit() when measured diameter is smaller than fitted waist
- fix divide-by-zero in beam_parameter_product() and M² error propagation when waist or divergence is zero
- fix hardcoded figure number in m2_display that caused matplotlib warnings on repeated calls
- fix variable shadowing of plane-fit coefficient b in subtract_tilted_background()
- fix _format_beam_title() docstring: z parameter is in meters, not mm
- fix _fmt() NaN check to handle np.floating types, not just Python float
- fix M2_fit() zone-trimming loops to guard against None index when a zone is exhausted
- fix beam_parameter_product() zero-check to use np.isclose() instead of exact equality
- fix plot_image_analysis() minor-axis subplot x-limits used s_major_px instead of s_minor_px
- fix M2_fit() focal-zone trimming loop ignored the n_outer==4 special-case adjustment
- fix divide-by-zero in M2_radius_plot() and _fit_plot() when d0==0 and M2<1
- fix stale laserbeamsize.m2 reference in package docstring
- fix rotated_rect_mask() docstring: removed non-existent mask_diameters parameter
- fix _prepare_beam_analysis() docstring: return tuple listed 7 items but function returns 6
- fix create_test_image() docstring: corrected "magnitued" typo and documented valid ntype values
- fix elliptical_mask() silent all-False mask for zero diameter: now raises ValueError
- fix corner_background() docstring: now lists both corner_mean and corner_stdev
- fix rotate_points() docstring: explains why -phi is used internally
- replace print() with warnings.warn() in M2_fit() for strict-mode messages
- replace Python loops with numpy in max_index_in_focal_zone() and min_index_in_outer_zone()
- remove dead code: basic_beam_size_naive(), rotated_rect_mask_slow(), _mean_filter(), _std_filter(), image_background2()
- remove unused scipy.ndimage import from background.py
- add PEP 484 type annotations to all public and private functions across all source modules
- fix mypy errors that surfaced after adding type annotations
- add comprehensive tests for all fixed issues
M2_report now handles focal length of lens
2.3.2 (2026-03-05)
- complete
M2_report()support for focal length - add tests for major/minor fits
- add entry to 14-M2-Example.ipynb for new M2_report()
2.3.1 (2026-02-04)
- fix regression when units=None
- fix image display in docs
- update github workflows
- default python is 3.12
- all requirements are in pyproject.toml
- faster testing with pytest
- fix errors in .yaml files
Fix units in plot_image_analysis()
Fix regression when working with images and having units=None
2.3.1
- fix regression when units=None
- fix image display and link in docs
- update github workflows
- default python is 3.12
- all package requirements are in pyproject.toml
- faster testing with pytest
- fix errors in .yaml files
- clean up docs/conf.py to work better
Better pictures, minor bug fixes
2.3.0
- Jupyterlite updated to 0.64
- fix bug with strongly asymmetric rotated beams
- fix jupyterlite import of npy files
- fix integration rect drawing when mask_diameters is not the default
- fix handling for failed d_minor calculation
- add make lab target
- add make readme target for images
- improve handling of small images
- improve plot_image_analysis
- improve citations
- refactored functions in display.py
- background.py works with images having masks
Full Changelog: 2.2.0...2.3.0
Add Jupyterlite support
2.2.0
- Jupyterlite support on github pages
- eliminate circular imports
- use venv for packaging and testing
- remove setup.py and setup.sh
- no longer package test files
- clean up MANIFEST.IN
- improve pyproject.toml
- improve README.rst
- requirements-dev.txt is now complete
Fixed beam angle fully supported
This version fixes a number of issues when specifying a fixed angle for the major axis of the elliptical beam. This introduces an api change because now specifying the angle requires using the phi_fixed instead of phi
xc, yc, d_major, d_minor, phi = lbs.basic_beam_size(image, phi_fixed=np.pi/2)As part of this fix, the program now always reports the major and minor axis sizes (diameters). The angle returned is always between the major axis and the horizontal axis and will always be between -𝜋/2 < ɸ ≤ 𝜋/2
2.1.0
- make fixed angle work much better (thanks @przemororo)
- use major axis (d_major) instead of dx (near x-axis)
- trim distribution down to core files
- eliminate dependence on pillow and scikit-image
- correct angle definitions
- use black for all formatting
- adopt
pyproject.tomlwith PEP 621 metadata and eliminate setup.cfg - lint YAML files and run
ruffduringmake rcheck - allow
iso_noiseoption in display and background functions - rename
tests/test_all_notebooks.pytotests/all_test_notebooks.py - replace
masterbranch references withmainin docs - numerous style and docstring improvements
- remove flake8
- bump minimum python version to 3.9
- eliminate non-standard use of semi-major and semi-minor
fix error in focused_diameter
2.0.5
- fix mistake in focused_diameter (thanks @rdgraham)
2.0.4
- fix zenodo and CITATION.cff
- fix pypi github action
- fix copyright
- fix manifest
- correct README.rst to use
plot_image_analysis() - tweak badges
- allow fixed phi angle of 0° (thanks @cptyannick)
First release with new github actions
2.0.4
- allow fixed phi angle of 0° (thanks @cptyannick)
- fix zenodo and CITATION.cff
- fix pypi github action
- fix copyright
- fix manifest
- correct README.rst to use
plot_image_analysis() - tweak badges
Major changes from 2.0.0
- change default background removal to match ISO recommendation
- split monolithic laserbeamsize module in separate modules
- rationalized functions names (API changes!)
ISO background handling, better packaging
2.0.3
- readthedocs does not do well with new module names
2.0.2
- splitting monolithic m2.py
- added tests for functions in gaussian.py
- improved docstrings in gaussian.py
- improved module docstrings in m2_fit and m2_display
2.0.1
- trying to get conda release working
2.0.0
- change default background removal to match ISO recommendation
- split monolithic laserbeamsize module in separate modules
- rationalized functions names
- add citation stuff
- add github actions to test and update citation
- improve readme so images work on pypi.org
- add conda-forge support
- update copyright years
- more badges