Release notes
3.3.1
Added:
Add regex parsing ability in
PDFParserfor file headers that do not have the structure output by xPDFsuite and PDFgetX.
3.3.0
Added:
Added
add_parameter_setmethod to replace deprecatedFitRecipe.addParameterSet.Added
add_parameter_setmethod to replace deprecatedParameterSet.addParameterSet.Added diffpy.structure back to the requirements and run the test
Added
add_constraintmethod toRecipeOrganizer.Added
remove_constraintmethod toRecipeOrganizer.Added
add_soft_boundsmethod toRecipeOrganizer.Added
remove_soft_boundsmethod toRecipeOrganizer.Added
register_soft_boundsmethod toRecipeOrganizer.Added
clear_all_soft_boundsmethod toRecipeOrganizer.Added
get_equation_from_stringmethod toRecipeOrganizer.Add
parse_filemethod toProfileParserto parse a file directly withload_datafromdiffpy.utils.Add
_parse_metadataand_parse_datahooks toProfileParser, which subclasses override to support a new data format.parse_fileis a template method that calls them.Add
get_num_banksmethod toProfileParserto replacegetNumBanks.Add
select_bankmethod toProfileParserto replaceselectBank.Add
get_formatmethod toProfileParserto replacegetFormat.Add
get_datamethod toProfileParserto replacegetData.Add
get_metadatamethod toProfileParserto replacegetMetaData.Added
get_equationmethod toBaseBuilder.Added
get_equationmethod toFitContribution.Add
plot_recipemethod toFitRecipe.Added
initialize_recipe_with_resultstoFitRecipe.Added
iterate_over_parametersmethod.Added
register_calculatormethod.Added
register_functionmethod.Added
register_string_functionmethod.Added
evaluate_equationmethod.Added
is_constrainedmethod.Added
get_constrained_parametersmethod.Added
clear_all_constraintsmethod.Added
add_profile_generatorto replace deprecated function.Added
is_constantmethod toParameter.Added
bound_rangemethod toParameter.Added
bound_windowmethod toParameter.Added
set_weightmethod toFitRecipeto replacesetWeight.Added
get_fit_hooksmethod toFitRecipeto replacegetFitHooks.Added
clear_fit_hooksmethod toFitRecipeto replaceclearFitHooks.Added
pop_fit_hookmethod toFitRecipeto replacepopFitHook.Added
push_fit_hookmethod toFitRecipeto replacepushFitHook.Add
spherical_particle,spheroidal_particle,lognormal_spherical_particle,sheet_particle, andshell_particletodiffpy.srfit.pdf.characteristicfunctions, replacingsphericalCF,spheroidalCF,lognormalSphericalCF,sheetCF, andshellCF.Add
constrain_as_space_grouptodiffpy.srfit.structure.sgconstraints, replacingconstrainAsSpaceGroup.Added
get_residual_equationmethod toFitContribution.Added
set_residual_equationmethod toFitContribution.Added
set_valuemethod todiffpy.srfit.fitbase.Parameter.Added
save_resultsmethod toFitResults.Added
print_resultsmethod toFitResults.Added
get_results_stringmethod toFitResults.Added
create_new_variablemethod toFitRecipe.Added
delete_variablemethod toFitRecipe.Added
add_variablemethod toFitRecipe.Added
scalar_residualmethod toFitRecipe.Added
remove_parameter_setmethod toFitRecipe.Added test for
remove_parameter_setmethod inFitRecipe.Added initialize_recipe_from_recipe to
FitRecipe.Added
convert_bounds_to_restraintsmethod toFitRecipe.Added
get_bounds_pairsmethod toFitRecipe.Added
get_bounds_arraymethod toFitRecipe.Added
get_namesmethod toFitRecipeandRecipeContainer.Added
get_valuesmethod toFitRecipeandRecipeContainer.Added
is_freemethod toFitRecipe.Added
set_equationmethod to replacesetEquation.Added
FitResults.get_results_dictionaryin replace ofresultsDictionary.Added
add_contributionin replace ofaddContribution.Support for Python 3.14
Added
load_parsed_datain replace ofloadParsedDatainProfileandSimpleRecipe.Added
set_observed_profilein replace ofsetObservedProfileinProfileandSimpleRecipe.Added
set_calculation_rangein replace ofsetCalculationRangeinProfileandSimpleRecipe.Added
set_calculation_pointsin replace ofsetCalculationPointsinProfileandSimpleRecipe.
Changed:
Change
PDFParserto inherit_parse_metadataand_parse_dataunchanged fromProfileParser, since PDFgetX and PDFgetN headers are now plainname = valuepairs.PDFParser.parse_filereturns the same data and metadata thatPDFParser.parseFiledid.Change
ProfileParser.parse_fileto accept the keyword arguments ofload_data, such asusecols,delimiterandcomments. Useusecolsto select columns from a file with more than four of them.Change
PDFContribution.loadDatato take a file name only.Change the headers of the
si-q27r60-xray.grandni-q27r100-neutron.grtest files to the moderndiffpy.pdfgetxand xPDFsuite configuration formats, replacing the 2008-era PDFgetX2/PDFgetN headers. The data values are unchanged.Change
spheroidalCF2andshellCF2indiffpy.srfit.pdf.characteristicfunctionsto be deprecated aliases that convert their arguments and callspheroidal_particleandshell_particle, instead of separate implementations.Change the current characteristic functions in
diffpy.srfit.pdf.characteristicfunctions(spherical_particle,spheroidal_particle,lognormal_spherical_particle,sheet_particleandshell_particle) to emit aRuntimeWarningwhen 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_particleindiffpy.srfit.pdf.characteristicfunctionsto return zero for a negativeparticle_diameter_sigmainstead of silently returningspherical_particle. Aparticle_diameter_sigmaof zero is still the sphere limit.Change
sheet_particleindiffpy.srfit.pdf.characteristicfunctionsto return an array of zeros for a non-positivesheet_thicknesswhenris an array, instead of a scalar zero.Change
ProfileParser.parse_fileto set unavailabledx/dyuncertainties toNoneinstead of0, matching the format-specific parsers.Change
Profile.set_observed_profileto leavedyobsasNonewhen no uncertainties are observed, instead of silently replacing them with an array of ones. The calculateddystill defaults to 1 at every calculation point, so unweighted fits refine exactly as before.Change
Profile._validateto accept aNonedyobs, since observed uncertainties are optional.x,y,dy,xobsandyobsare still required.Changed iterPars method to match all equal-type atoms to have same ADPs
Deprecated:
Deprecated
addParameterSetmethod inFitRecipe.Deprecate
addParameterSetmethod inParameterSet.Deprecated
constrainmethod ofRecipeOrganizer. Useadd_constraintinstead.Deprecated
unconstrainmethod ofRecipeOrganizer. Useremove_constraintinstead.Deprecated
restrainmethod ofRecipeOrganizer. Useadd_soft_boundsinstead.Deprecated
unrestrainmethods ofRecipeOrganizer. Useremove_soft_boundsinstead.Deprecated
addRestraintmethod ofRecipeOrganizer. Useregister_soft_boundsinstead.Deprecate
clearRestraintsmethod ofRecipeOrganizer. Useclear_all_soft_boundsinstead.Deprecated
equationFromStringmethod ofRecipeOrganizer. Useget_equation_from_stringinstead.Deprecate
getNumBanks,selectBank,getFormat,getData, andgetMetaDatainProfileParser.Deprecate
ProfileParser.parseFile, which now delegates toparse_file. Useparse_fileinstead.Deprecated
BaseBuilder.getEquationmethod for removal in 4.0.0.Deprecated
FitContributution.getEquationmethod for removal in 4.0.0.Deprecated
iterParsmethod. Useiterate_over_parametersinstead.Deprecated
registerCalculatormethod. Useregister_calculatorinstead.Deprecated
registerFunctionmethod. Useregister_functioninstead.Deprecated
registerStringFunctionmethod. Useregister_string_functioninstead.Deprecated
evaluateEquationmethod. Useevaluate_equationinstead.Deprecated
isConstrainedmethod. Useis_constrainedinstead.Deprecated
getConstrainedParsmethod. Useget_constrained_parametersinstead.Deprecated
clearConstraintsmethod. Useclear_all_constraintsinstead.Deprecate
setProfilefor removal in version 4.0.0.Deprecated
addProfileGeneratorfor removal in 4.0.0.Deprecated
isConstmethod ofParameter. Useis_constantinstead.Deprecated
boundRangemethod ofParameter. Usebound_rangeinstead.Deprecated
boundWindowmethod ofParameter. Usebound_windowinstead.Deprecated
setWeightinFitRecipefor removal in 4.0.0.Deprecated
getFitHooksinFitRecipefor removal in 4.0.0.Deprecated
clearFitHooksinFitRecipefor removal in 4.0.0.Deprecated
popFitHookinFitRecipefor removal in 4.0.0.Deprecated
pushFitHookinFitRecipefor removal in 4.0.0.Deprecate
sphericalCF,spheroidalCF,spheroidalCF2,lognormalSphericalCF,sheetCF,shellCF, andshellCF2indiffpy.srfit.pdf.characteristicfunctions.Deprecate
constrainAsSpaceGroupindiffpy.srfit.structure.sgconstraints.Deprecated
getResidualEquationmethod ofFitContributionfor removal in 4.0.0.Deprecated
setResidualEquationmethod ofFitContributionfor removal in 4.0.0.Deprecated
setValuemethod indiffpy.srfit.fitbase.Parameterfor removal in 4.0.0.Deprecated
saveResultsmethod for removal in 4.0.0.Deprecated
printResultsmethod for removal in 4.0.0.Deprecated
formatResultsmethod for removal in 4.0.0.Deprecated
newVarmethod for removal in 4.0.0.Deprecated
delVarmethod for removal in 4.0.0.Deprecated
addVarmethod for removal in 4.0.0.Deprecated
scalarResidualmethod for removal in 4.0.0.Deprecated
removeParameterSetmethod for removal in 4.0.0.Deprecated
boundsToRestraintsmethod for removal in 4.0.0.Deprecated
getBoundsmethod for removal in 4.0.0.Deprecated
getBounds2method for removal in 4.0.0.Deprecated
getNamesmethod for removal in 4.0.0.Deprecated
getValuesmethod for removal in 4.0.0.Deprecated
isFreemethod for removal in 4.0.0.Deprecated
setEquationfor removal in 4.0.0.Deprecated
resultsDictionaryfor removal in 4.0.0.Deprecated
addContributionfor removal in 4.0.0.Deprecated
loadParsedDatainProfileandSimpleRecipefor removal in 4.0.0.Deprecated
setObservedProfileinProfileandSimpleRecipefor removal in 4.0.0.Deprecated
setCalculationRangeinProfileandSimpleRecipefor removal in 4.0.0.Deprecated
setCalculationPointsinProfileandSimpleRecipefor removal in 4.0.0.
Fixed:
Fixed load new parsed data with updated Qmax attribute
Fix
PDFParser.parse_fileandPDFContribution.loadDatadiscarding PDF metadata. They parsed PDFgetX and PDFgetN headers as genericname = valuepairs, which droppedstype,qmin,qmax,qdampandqbroad, soPDFGeneratorsilently fell back to its default scattering type and Q range.Update codebase to scikit-package 0.3.0 standards.
Updated project to the latest scikit-package template
Fix
shell_particleindiffpy.srfit.pdf.characteristicfunctionsreturning a smoothly varying branch of unphysical values, some below negative one, for a negativethicknessorradius, which a refinement could mistake for a real solution. It now returns zero.Fix
shell_particleindiffpy.srfit.pdf.characteristicfunctionsreturning one at everyrfor a zerothickness, where the normalizing denominator vanishes. It now returns zero.Fix
spheroidal_particleindiffpy.srfit.pdf.characteristicfunctionsraisingZeroDivisionErrorfor a zeroequatorial_radius. It now returns zero.Fix
ProfileParser.parse_fileproducing zero-valued uncertainties for absent or invaliddx/dycolumns, which gave non-finite residuals for any file without usable uncertainties instead of falling back to an unweighted fit.Fix
Profile.dyobsreporting an array of ones for data that carries no uncertainties, which made an unweighted profile indistinguishable from one whose uncertainties were genuinely all 1.
Removed:
Remove
parseStringfromProfileParser, andPDFParser. Parsers read from a file, so a format is now supported by overriding the_parse_metadataand_parse_datahooks.Remove support for passing a data string or an open file object to
PDFContribution.loadData. Pass a file name instead.Support for Python 3.11
3.2.0
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.1.0
Version 3.0.0 – 2019-03-14
Added:
Support for Python 3.7, 3.6, 3.5 in addition to 2.7.
Changed:
Always use lower-case imports from diffpy.structure.
Use numeric-value sort to order variables in PrintFitHook.
Deprecated:
Variable __gitsha__ in the version module renamed to __git_commit__.
Removed:
Optional upper and lower-bound arguments in Parameter.setValue. The bounds can be set with Parameter.boundRange instead.
Unused classes ListOperator, SetOperator.
Fixed:
Metadata retrieval from PDFContribution hierarchy.
Refresh PDFGenerator when its rgrid is changed in-place.
Zero division in the nppdfsas.py example.
Crash in ellipsoidsas.py example because of bug in Parameter.setValue.
Pickling of ProfileGenerator objects and of bound class methods.
Invalid escape sequences in string values.