Molass Library Reference#
Molass Library is a rewrite of MOLASS, a tool for the analysis of SEC-SAXS experiment data currently hosted at Photon Factory and SPring-8, Japan.
This document describes each function of the library.
For more structural information, see also:
Tutorial: https://biosaxs-dev.github.io/molass-tutorial on practical usage, for beginners
Essence: https://biosaxs-dev.github.io/molass-essence on theory, for researchers
Technical Report: https://biosaxs-dev.github.io/molass-technical/ on technical details, for advanced users
Legacy Reference: https://biosaxs-dev.github.io/molass-legacy/ for function reference of the GUI application version, the predecessor.
To join the community, see also:
Handbook: https://biosaxs-dev.github.io/molass-develop on maintenance, for developers.
Module Functions#
- to_int_tuple(version_string)#
Convert a version string to a tuple of integers for comparison.
- Parameters:
version_string (str) – A version string in the format ‘major.minor.patch’.
- Returns:
tuple
- Return type:
A tuple of integers representing the version.
- class Version(version_string)#
Bases:
objectA class to represent and compare software version strings.
- get_version(toml_only=False)#
Retrieve the version of the package from pyproject.toml or importlib.metadata.
This function prioritizes reading the version from pyproject.toml to ensure that the local repository version is used during development or testing. If pyproject.toml is not found, it falls back to using importlib.metadata to retrieve the version of the installed package.
- Parameters:
toml_only (bool, optional) –
If True, the function strictly reads the version from pyproject.toml. This is crucial to avoid confusion about the version being used, which can lead to significant time loss during testing. (confusion about the local repository versus the installed).
If False, the function attempts to read the version from pyproject.toml first. If pyproject.toml does not exist, which means you are using the installed package, it falls back to using importlib.metadata to retrieve this version.
- Returns:
An instance of the Version class representing the package version.
- Return type:
- Raises:
AssertionError: – If toml_only is True but pyproject.toml is not found. This ensures that the function behaves predictably in cases where the local repository is not available.
This docstring was improved in collaboration with GitHub Copilot. –
- requires(version)#
Assert that the installed molass version meets a minimum requirement.
Use this at the top of notebooks or tutorial tests instead of a raw
assert get_version() >= '...'to make the version dependency explicit and easily discoverable.- Parameters:
version (str) – Minimum required version string, e.g.
'0.8.5'.- Raises:
ImportError – If the installed molass version is older than version.
Examples
>>> from molass import requires >>> requires('0.8.5')
Submodules#
- Baseline
- Bridge
- DataObjects
- Submodules
- DataObjects.Curve
CurveCurve.xCurve.yCurve.typeCurve.max_iCurve.max_xCurve.max_yCurve.peaksCurve.momentCurve.splineCurve.diff_splineCurve.get_xy()Curve.set_max()Curve.get_max_i()Curve.get_max_y()Curve.get_max_x()Curve.get_max_xy()Curve.get_peaks()Curve.get_num_major_peaks()Curve.get_moment()Curve.smooth_copy()Curve.get_spline()Curve.get_diff_spline()Curve.corrected_copy()
create_icurve()create_jcurve()
- DataObjects.SecSaxsData
SecSaxsDataSecSaxsData.xrSecSaxsData.uvSecSaxsData.trimmedSecSaxsData.mappingSecSaxsData.beamline_infoSecSaxsData.time_initializedSecSaxsData.time_requiredSecSaxsData.time_required_totalSecSaxsData.datafilesSecSaxsData.loggerSecSaxsData.has_xr()SecSaxsData.has_uv()SecSaxsData.plot_3d()SecSaxsData.plot_compact()SecSaxsData.make_trimming()SecSaxsData.plot_trimming()SecSaxsData.copy()SecSaxsData.trimmed_copy()SecSaxsData.set_baseline_method()SecSaxsData.get_baseline_method()SecSaxsData.corrected_copy()SecSaxsData.estimate_mapping()SecSaxsData.get_mapping()SecSaxsData.get_concfactor()SecSaxsData.quick_decomposition()SecSaxsData.rigorous_decomposition()SecSaxsData.inspect_ip_effect()SecSaxsData.get_uv_device_id()SecSaxsData.get_beamline_name()SecSaxsData.export()SecSaxsData.plot_varied_decompositions()SecSaxsData.get_spectral_vectors()
- DataObjects.SsMatrixData
SsMatrixDataSsMatrixData.ivSsMatrixData.jvSsMatrixData.MSsMatrixData.dataSsMatrixData.ESsMatrixData.momentSsMatrixData.baseline_methodSsMatrixData.dataSsMatrixData.q_valuesSsMatrixData.frame_indicesSsMatrixData.copy()SsMatrixData.get_icurve()SsMatrixData.get_jcurve()SsMatrixData.get_recognition_curve()SsMatrixData.get_moment()SsMatrixData.set_baseline_method()SsMatrixData.get_baseline_method()SsMatrixData.get_baseline2d()SsMatrixData.get_snr_weights()SsMatrixData.get_positive_ratio()SsMatrixData.get_bpo_ideal()SsMatrixData.get_ideal_positive_ratio()SsMatrixData.evaluate_baseline()
- DataObjects.UvData
- DataObjects.XrData
XrDataXrData.qvXrData.baseline_methodXrData.xr_pickatXrData.copy()XrData.get_ipickvalue()XrData.get_icurve()XrData.get_recognition_curve()XrData.get_usable_qrange()XrData.get_ibaseline()XrData.compute_rgcurve()XrData.compute_rgcurve_atsas()XrData.detect_peaks()XrData.plot_peaks()XrData.get_jcurve_array()
- DataObjects.Curve
- Submodules
- DataUtils
- Decompose
- DensitySpace
- Except
- FlowChange
- Geometric
- Global
- Guinier
- InterParticle
- Legacy
- Local
- Logging
- LowRank
- Submodules
- LowRank.AlignDecompositions
- LowRank.BoundedLrf
- LowRank.Component
ComponentComponent.icurve_arrayComponent.jcurve_arrayComponent.ccurveComponent.peak_indexComponent.icurveComponent.jcurveComponent.areaComponent.ccurveComponent.get_icurve()Component.get_jcurve()Component.get_jcurve_array()Component.compute_area()Component.compute_range()Component.make_paired_range()
XrComponentUvComponent
- LowRank.ComponentCurve
- LowRank.ComponentReliability
- LowRank.ConsistentAdjuster
- LowRank.CoupledAdjuster
- LowRank.CurveDecomposer
- LowRank.Decomposition
DecompositionDecomposition.ssdDecomposition.xrDecomposition.xr_icurveDecomposition.xr_ccurvesDecomposition.xr_ranksDecomposition.uvDecomposition.uv_icurveDecomposition.uv_ccurvesDecomposition.uv_ranksDecomposition.mappingDecomposition.mapped_curveDecomposition.paired_rangesDecomposition.num_componentsDecomposition.copy_with_new_components()Decomposition.xr_componentsDecomposition.uv_componentsDecomposition.get_num_components()Decomposition.get_guinier_objects()Decomposition.get_rgs()Decomposition.get_rg_curve()Decomposition.get_P_at()Decomposition.component_quality_scores()Decomposition.is_component_reliable()Decomposition.plot_components()Decomposition.update_xr_ranks()Decomposition.get_xr_matrices()Decomposition.get_xr_components()Decomposition.get_uv_matrices()Decomposition.get_uv_components()Decomposition.get_pairedranges()Decomposition.get_proportions()Decomposition.compute_scds()Decomposition.get_cd_color_info()Decomposition.optimize_with_model()Decomposition.make_rigorous_initparams()Decomposition.optimize_rigorously()
- LowRank.ErrorPropagate
- LowRank.LowRankInfo
- LowRank.PairedRange
- LowRank.PositionedDecomposer
- LowRank.ProportionalDecomposer
- LowRank.QuickImplement
- Submodules
- Mapping
- MathUtils
- PackageUtils
- Peaks
- PlotUtils
- Submodules
- PlotUtils.Annotation3D
- PlotUtils.Arrow3D
- PlotUtils.Comparison
- PlotUtils.DecompositionPlot
- PlotUtils.GuinierPlot
- PlotUtils.MatrixPlot
- PlotUtils.PlotResult
- PlotUtils.SecSaxsDataPlot
- PlotUtils.SsMatrixDataPlot
- PlotUtils.TrimmingPlot
- PlotUtils.TwinAxesUtils
- PlotUtils.V1GuinierPlot
- PlotUtils.V1KratkyPlot
- PlotUtils.ViewArrows
- Submodules
- Progress
- Reports
- Submodules
- Reports.Controller
ControllerController.env_infoController.ssdController.preprocController.kwargsController.loggerController.work_folderController.bookpathController.excel_is_availableController.excel_versionController.atsas_is_availableController.more_multicoreController.conc_trackerController.temp_folderController.result_wbController.tellerController.excel_clientController.prepare_averaged_data()Controller.make_temp_folder()Controller.stop()Controller.stop_check()Controller.cleanup()Controller.error_cleanup()
- Reports.Migrating
- Reports.ReportRange
- Reports.V1GuinierReport
- Reports.V1LrfReport
- Reports.V1Report
- Reports.V1SummaryReport
- Reports.Controller
- Submodules
- Rigorous
- SAXS
- SAXS.Models
- ScipyUtils
- SEC
- Submodules
- SEC.Models
- Submodules
- SEC.Models.EDM
- SEC.Models.EdmComponentCurve
- SEC.Models.EdmEstimator
- SEC.Models.EdmEstimatorImpl
- SEC.Models.EdmOptimizer
- SEC.Models.GEC
- SEC.Models.LognormalPore
- SEC.Models.SDM
- SEC.Models.SdmComponentCurve
- SEC.Models.SdmEstimator
- SEC.Models.SdmMonoPore
- SEC.Models.SdmOptimizer
- SEC.Models.Simple
- SEC.Models.UvComponentCurve
- SEC.Models.UvOptimizer
- Submodules
- SEC.Models
- Submodules
- SEC.ColumnElements
SolidGrainSolidGrain.id_SolidGrain.centerSolidGrain.radiusSolidGrain.poreradiusSolidGrain.poredistSolidGrain.entriesSolidGrain.compute_poreentries()SolidGrain.draw_entries()SolidGrain.draw()SolidGrain.get_point_from_angle()SolidGrain.get_entry_including()SolidGrain.compute_bounce_vector()SolidGrain.compute_inpore_nextpos()
ParticleNewGrainnew_grain_unit_test()grain_particle_test()draw_wedges()
- SEC.ColumnSimulation
- SEC.ColumnSliceStates
- SEC.ColumnStructure
- SEC.ModelFactory
- SEC.StationaryMove
- SEC.ColumnElements
- Submodules
- SEC.Models
- Submodules
- SEC.Models.EDM
- SEC.Models.EdmComponentCurve
- SEC.Models.EdmEstimator
- SEC.Models.EdmEstimatorImpl
- SEC.Models.EdmOptimizer
- SEC.Models.GEC
- SEC.Models.LognormalPore
- SEC.Models.SDM
- SEC.Models.SdmComponentCurve
- SEC.Models.SdmEstimator
- SEC.Models.SdmMonoPore
- SEC.Models.SdmOptimizer
- SEC.Models.Simple
- SEC.Models.UvComponentCurve
- SEC.Models.UvOptimizer
- Submodules
- Shapes
- Stats
- SurveyUtils
- Testing
- Trimming