Releases: diffpy/diffpy.srfit
Releases · diffpy/diffpy.srfit
3.4.0
Sorry, something went wrong.
No results found
Added:
- Add make_equation, register_constant, register_argument,
register_operator, register_builder and deregister_builder to
EquationFactory, and wrap_argument, wrap_operator,
wrap_function and get_builder to diffpy.srfit.equation.builder.
- Add Equation.set_root, Operator.add_literal and make_operator to
diffpy.srfit.equation.
- Add get_args, get_expression and pretty_print to
diffpy.srfit.equation.visitors, and on_argument, on_operator and
on_equation to Visitor.
- Add parallel fitting example.
- Add add_observer, remove_observer and has_observer to
Observable, and has_tags and verify_tags to TagManager.
- Add is_identifier and validate_name to diffpy.srfit.util.nameutils,
convert_input_to_string to diffpy.srfit.util.inpututils, and
sort_key_for_numeric_string to diffpy.srfit.util.
- Document the *=, %=, +=, |=, and << shorthand operators in the diffpy.srfit.interface API reference.
- The public fitbase classes can now be imported directly from
diffpy.srfit, for example from diffpy.srfit import FitRecipe.
- The test suite now fails if srfit's own source code calls one of srfit's
deprecated names, so an internal caller missed during a deprecation is
caught in CI.
Changed:
- OperatorABC now requires add_literal instead of addLiteral, and
Visitor subclasses now override on_argument, on_operator and
on_equation instead of onArgument, onOperator and
onEquation.
- Rewrite the diffpy.srfit.fitbase docstrings in NumPy style, and correct
those that described the wrong types, defaults or raised exceptions.
- The error raised for an invalid name now says how to fix it.
- Importing diffpy.srfit no longer imports matplotlib.pyplot or
changes the global matplotlib style. FitRecipe.plot_recipe still uses
the bg-style stylesheet, but only for the figures it creates.
Deprecated:
- EquationFactory.makeEquation, registerConstant, registerArgument,
registerOperator, registerBuilder and deRegisterBuilder,
wrapArgument, wrapOperator, wrapFunction, getBuilder,
Equation.setRoot, Operator.addLiteral, makeOperator,
getArgs, getExpression, prettyPrint and Visitor.onArgument,
onOperator and onEquation are deprecated in favor of their
snake_case replacements. The old names still work and warn, and will be
removed in version 4.0.0.
- getValue is deprecated in favour of get_value on Parameter and on
the Literal hierarchy (Argument, Operator, Equation). The old
name still works and warns, and will be removed in version 4.0.0.
- Observable.addObserver, removeObserver and hasObserver,
TagManager.hasTags and verifyTags, isIdentifier,
validateName, inputToString and sortKeyForNumericString are
deprecated in favour of their snake_case replacements. The old names still
work and warn, and will be removed in version 4.0.0.
- ParameterSet.addParameter, ParameterSet.newParameter and
ParameterSet.removeParameter are deprecated in favour of
add_parameter, new_parameter and remove_parameter. The old names
still work and warn, and will be removed in version 4.0.0.
Fixed:
- Fix the test check for observers left on global equation builders.
- Fix the equationFromString deprecation warning, which pointed to a
nonexistent RecipeOrganizer.get_equation_from_string instead of
diffpy.srfit.fitbase.recipeorganizer.get_equation_from_string.
- show() no longer fails when the recipe holds BVS or ObjCryst molecule restraints, or a Restraint added with register_soft_bounds.
- Set the scattering factor table through the scatteringfactortable property in setScatteringType instead of the setScatteringFactorTableByType method deprecated in diffpy.srreal.
- SASProfile now updates its wrapped SAS DataInfo object when the
observed profile is set through set_observed_profile or
load_parsed_data. Previously only the deprecated setObservedProfile
did this.
- FitRecipe tests no longer depend on the diffpy.srfit.pdf package.
- Apply restraints and constraints added to a FitContribution or ParameterSet after its FitRecipe has been evaluated. Before, they were ignored until the recipe was reset.
- Point the README CI badge at the matrix-and-codecov.yml workflow so it renders.
- Use get_space_group, position_formulas, and u_formulas in place of the deprecated diffpy.structure functions GetSpaceGroup, positionFormulas, and UFormulas to silence deprecation warnings.
- Use add_constraint and add_soft_bounds in the *= and %= operators of RecipeOrganizerInterface so they no longer raise deprecation warnings for constrain and restrain.
- Use pyobjcryst.crystal.create_crystal_from_cif, scipy.optimize.leastsq, and the particle_diameter argument of spherical_particle in the examples in place of deprecated or renamed APIs.
- Creating a FitRecipe no longer emits a DeprecationWarning about
pushFitHook.
- initializeRecipe now emits only its own DeprecationWarning instead of
also warning about resultsDictionary.
- Fix API docstrings so code examples in RecipeOrganizer.add_soft_bounds and iterate_over_parameters render, and fix docstring formatting errors in ProfileParser, PDFParser, lognormal_spherical_particle, and the interface module.
- Fix broken include of the examples README in the examples documentation page.
Removed:
- Removed the undeclared six dependency and the leftover Python 2
compatibility code that used it.
3.4.0-rc.0
Sorry, something went wrong.
No results found
What's Changed
- deprecate: addParameter, newParameter, and removeParameter deprecation by @cadenmyers13 in #214
- dep: getValue deprecation in favor of snake case by @cadenmyers13 in #215
- fix: clean up core srfit before the subpackage split by @cadenmyers13 in #217
- fix: fail tests when srfit calls its own deprecated API by @cadenmyers13 in #216
- feat: export the fitbase API from diffpy.srfit by @cadenmyers13 in #218
- refactor: bring diffpy.srfit.util up to standards by @cadenmyers13 in #220
- deprecate and refactor: deprecate camelCase functions in diffpy.srfit.equation and refactor test for pytest format by @cadenmyers13 in #221
- refactor and style: Refactor unittest tests for in favor of pytest and update docstrings in fitbase by @cadenmyers13 in #222
- fix: Replaced deprecated setScatteringFactorTableByType with scatteringfactortable by @cadenmyers13 in #225
- chore: point README CI badge at matrix-and-codecov.yml by @cadenmyers13 in #224
- fix: allow constraints and restraints to be added after recipe is evaluated by @cadenmyers13 in #226
- fix: fix .show() crash when restraints weren't added add_soft_bounds() by @cadenmyers13 in #227
- test: fix pytest warnings being raised by @cadenmyers13 in #228
- docs: fix API docstrings that don'tt render and broken example README by @cadenmyers13 in #229
- dep & test: Replace deprecated functions and add tests for interface.py by @cadenmyers13 in #230
- Parsertest fix by @cadenmyers13 in #231
Full Changelog: 3.3.1...3.4.0-rc.0
3.3.1
Sorry, something went wrong.
No results found
Added:
- Add regex parsing ability in PDFParser for file headers that do not have the structure output by xPDFsuite and PDFgetX.
3.3.1-rc.0
Sorry, something went wrong.
No results found
What's Changed
- refactor and feat: Add parsing ability for NOMAD datafiles and breakout tests in test_pdf.py into respective files by @cadenmyers13 in #207
- update installation instructions by @sbillinge in #209
Full Changelog: 3.3.0...3.3.1-rc.0
3.3.0
Sorry, something went wrong.
No results found
Added:
- Added add_parameter_set method to replace deprecated FitRecipe.addParameterSet.
- Added add_parameter_set method to replace deprecated ParameterSet.addParameterSet.
- Added diffpy.structure back to the requirements and run the test
- Added add_constraint method to RecipeOrganizer.
- Added remove_constraint method to RecipeOrganizer.
- Added add_soft_bounds method to RecipeOrganizer.
- Added remove_soft_bounds method to RecipeOrganizer.
- Added register_soft_bounds method to RecipeOrganizer.
- Added clear_all_soft_bounds method to RecipeOrganizer.
- Added get_equation_from_string method to RecipeOrganizer.
- Add parse_file method to ProfileParser to parse a file directly with load_data from diffpy.utils.
- Add _parse_metadata and _parse_data hooks to ProfileParser, which subclasses override to support a new data format. parse_file is a template method that calls them.
- Add get_num_banks method to ProfileParser to replace getNumBanks.
- Add select_bank method to ProfileParser to replace selectBank.
- Add get_format method to ProfileParser to replace getFormat.
- Add get_data method to ProfileParser to replace getData.
- Add get_metadata method to ProfileParser to replace getMetaData.
- Added get_equation method to BaseBuilder.
- Added get_equation method to FitContribution.
- Add plot_recipe method to FitRecipe.
- Added initialize_recipe_with_results to FitRecipe.
- Added iterate_over_parameters method.
- Added register_calculator method.
- Added register_function method.
- Added register_string_function method.
- Added evaluate_equation method.
- Added is_constrained method.
- Added get_constrained_parameters method.
- Added clear_all_constraints method.
- Added add_profile_generator to replace deprecated function.
- Added is_constant method to Parameter.
- Added bound_range method to Parameter.
- Added bound_window method to Parameter.
- Added set_weight method to FitRecipe to replace setWeight.
- Added get_fit_hooks method to FitRecipe to replace getFitHooks.
- Added clear_fit_hooks method to FitRecipe to replace clearFitHooks.
- Added pop_fit_hook method to FitRecipe to replace popFitHook.
- Added push_fit_hook method to FitRecipe to replace pushFitHook.
- Add spherical_particle, spheroidal_particle, lognormal_spherical_particle, sheet_particle, and shell_particle to diffpy.srfit.pdf.characteristicfunctions, replacing sphericalCF, spheroidalCF, lognormalSphericalCF, sheetCF, and shellCF.
- Add constrain_as_space_group to diffpy.srfit.structure.sgconstraints, replacing constrainAsSpaceGroup.
- Added get_residual_equation method to FitContribution.
- Added set_residual_equation method to FitContribution.
- Added set_value method to diffpy.srfit.fitbase.Parameter.
- Added save_results method to FitResults.
- Added print_results method to FitResults.
- Added get_results_string method to FitResults.
- Added create_new_variable method to FitRecipe.
- Added delete_variable method to FitRecipe.
- Added add_variable method to FitRecipe.
- Added scalar_residual method to FitRecipe.
- Added remove_parameter_set method to FitRecipe.
- Added test for remove_parameter_set method in FitRecipe.
- Added initialize_recipe_from_recipe to FitRecipe.
- Added convert_bounds_to_restraints method to FitRecipe.
- Added get_bounds_pairs method to FitRecipe.
- Added get_bounds_array method to FitRecipe.
- Added get_names method to FitRecipe and RecipeContainer.
- Added get_values method to FitRecipe and RecipeContainer.
- Added is_free method to FitRecipe.
- Added set_equation method to replace setEquation.
- Added FitResults.get_results_dictionary in replace of resultsDictionary.
- Added add_contribution in replace of addContribution.
- Support for Python 3.14
- Added load_parsed_data in replace of loadParsedData in Profile and SimpleRecipe.
- Added set_observed_profile in replace of setObservedProfile in Profile and SimpleRecipe.
- Added set_calculation_range in replace of setCalculationRange in Profile and SimpleRecipe.
- Added set_calculation_points in replace of setCalculationPoints in Profile and SimpleRecipe.
Changed:
- Change PDFParser to inherit _parse_metadata and _parse_data unchanged from ProfileParser, since PDFgetX and PDFgetN headers are now plain name = value pairs. PDFParser.parse_file returns the same data and metadata that PDFParser.parseFile did.
- Change ProfileParser.parse_file to accept the keyword arguments of load_data, such as usecols, delimiter and comments. Use usecols to select columns from a file with more than four of them.
- Change PDFContribution.loadData to take a file name only.
- Change the headers of the si-q27r60-xray.gr and ni-q27r100-neutron.gr test files to the modern diffpy.pdfgetx and xPDFsuite configuration formats, replacing the 2008-era PDFgetX2/PDFgetN headers. The data values are unchanged.
- Change spheroidalCF2 and shellCF2 in diffpy.srfit.pdf.characteristicfunctions to be deprecated aliases that convert their arguments and call spheroidal_particle and shell_particle, instead of separate implementations.
- Change the current characteristic functions in diffpy.srfit.pdf.characteristicfunctions (spherical_particle, spheroidal_particle, lognormal_spherical_particle, sheet_particle and shell_particle) to emit a RuntimeWarning when a non-physical shape parameter makes them return zero, since a zero return flattens the fit residual and stalls a refinement without any other sign to the user. The warning is issued once per process for each distinct problem so a refinement loop does not repeat it. The deprecated camel-case functions forward to these functions directly, so they emit the same warning and return the same result for non-physical input.
- Change lognormal_spherical_particle in diffpy.srfit.pdf.characteristicfunctions to return zero for a negative particle_diameter_sigma instead of silently returning spherical_particle. A particle_diameter_sigma of zero is still the sphere limit.
- Change sheet_particle in diffpy.srfit.pdf.characteristicfunctions to return an array of zeros for a non-positive sheet_thickness when r is an array, instead of a scalar zero.
- Change ProfileParser.parse_file to set unavailable dx/dy uncertainties to None instead of 0, matching the format-specific parsers.
- Change Profile.set_observed_profile to leave dyobs as None when no uncertainties are observed, instead of silently replacing them with an array of ones. The calculated dy still defaults to 1 at every calculation point, so unweighted fits refine exactly as before.
- Change Profile._validate to accept a None dyobs, since observed uncertainties are optional. x, y, dy, xobs and yobs are still required.
- Changed iterPars method to match all equal-type atoms to have same ADPs
Deprecated:
- Deprecated addParameterSet method in FitRecipe.
- Deprecate addParameterSet method in ParameterSet.
- Deprecated constrain method of RecipeOrganizer. Use add_constraint instead.
- Deprecated unconstrain method of RecipeOrganizer. Use remove_constraint instead.
- Deprecated restrain method of RecipeOrganizer. Use add_soft_bounds instead.
- Deprecated unrestrain methods of RecipeOrganizer. Use remove_soft_bounds instead.
- Deprecated addRestraint method of RecipeOrganizer. Use register_soft_bounds instead.
- Deprecate clearRestraints method of RecipeOrganizer. Use clear_all_soft_bounds instead.
- Deprecated equationFromString method of RecipeOrganizer. Use get_equation_from_string instead.
- Deprecate getNumBanks, selectBank, getFormat, getData, and getMetaData in ProfileParser.
- Deprecate ProfileParser.parseFile, which now delegates to parse_file. Use parse_file instead.
- Deprecated BaseBuilder.getEquation method for removal in 4.0.0.
- Deprecated FitContributution.getEquation method for removal in 4.0.0.
- Deprecated iterPars method. Use iterate_over_parameters instead.
- Deprecated registerCalculator method. Use register_calculator instead.
- Deprecated registerFunction method. Use register_function instead.
- Deprecated registerStringFunction method. Use register_string_function instead.
- Deprecated evaluateEquation method. Use evaluate_equation instead.
- Deprecated isConstrained method. Use is_constrained instead.
- Deprecated getConstrainedPars method. Use get_constrained_parameters instead.
- Deprecated clearConstraints method. Use clear_all_constraints instead.
- Deprecate setProfile for removal in version 4.0.0.
- Deprecated addProfileGenerator for removal in 4.0.0.
- Deprecated isConst method of Parameter. Use is_constant instead.
- Deprecated boundRange method of Parameter. Use bound_range instead.
- Deprecated boundWindow method of Parameter. Use bound_window instead.
- Deprecated setWeight in FitRecipe for removal in 4.0.0.
- Deprecated getFitHooks in FitRecipe for removal in 4.0.0.
- Deprecated clearFitHooks in FitRecipe for removal in 4.0.0.
- Deprecated popFitHook in ``FitRe...
Read more
3.3.0-rc.3
3.3.0-rc.2
Sorry, something went wrong.
No results found
What's Changed
Full Changelog: 3.2.0...3.3.0-rc.2
3.2.0
Sorry, something went wrong.
No results found
Changed:
- Temporarily removed support for SAS characteristic functions until we can migrate to the new sasview api.
- doc/ -> docs/
- requirements/test.txt -> requirements/tests.txt
Fixed:
- Better license designation in pyproject.toml
3.2.0-rc.2
3.2.0-rc.1
Sorry, something went wrong.
No results found
What's Changed
- chore: fix examples by @ycexiao in #131
- chore: sync conf.py extensions with docs dependencies listed in requirements folder by @zmx27 in #130
Full Changelog: 3.2.0-rc.0...3.2.0-rc.1