Conversation
Added numerical self consistent theory code, adapted from the work Paul Kienzle and Richard Sheridan in Refl1D
| def __init__( | ||
| self, | ||
| adsorbed_amount, | ||
| lattice_size, |
There was a problem hiding this comment.
lattice_size docstring missing
| self, | ||
| adsorbed_amount, | ||
| lattice_size, | ||
| polymerMW, |
There was a problem hiding this comment.
polymerMW docstring missing. (it's referred to as mn)?
| """ | ||
| Parameters | ||
| ---------- | ||
| Adsorbed Amount : Parameter or float |
There was a problem hiding this comment.
please order docstring in the same order that the parameters appear.
|
|
||
| dist_model : function or None | ||
| The model used to turn the PDI paramter into a probability density function of chain lengths. | ||
| If none the SZdist model is used. |
There was a problem hiding this comment.
Where is this PDF specified?
| rough : float | ||
| the (gaussian) roughness between slabs in the slab approximation of the profile | ||
|
|
||
| dist_model : function or None |
There was a problem hiding this comment.
What is dist_model, is it an rv_continuous, or a general callable? What is the call signature that the function should take?
| problems arise when the distribution gets too uniform, so if we find them, | ||
| default to an exact uniform calculation. | ||
| """ | ||
| from scipy.special import gammaln |
There was a problem hiding this comment.
This can be top level, doesn't need to be lazy import.
|
|
||
| Shultz-Zimm is a "realistic" distribution for linear polymers. Numerical | ||
| problems arise when the distribution gets too uniform, so if we find them, | ||
| default to an exact uniform calculation. |
There was a problem hiding this comment.
Parameters for docstring, what is PDI, what is nn?
There was a problem hiding this comment.
What is the function supposed to return?
|
|
||
| uniform = False | ||
|
|
||
| if pdi == 1.0: |
There was a problem hiding this comment.
comparing floats for equality can be a recipe for mistakes.
| Uses a numerical self-consistent field profile.\ [#Cosgrove]_\ [#deVos]_\ [#Sheridan]_ | ||
|
|
||
| **Parameters** | ||
| *chi* |
There was a problem hiding this comment.
Use numpydoc type formatting, e.g.
Parameters
-----------
Unless, this docstring is taken from refl1d, in which case leave as-is.
|
|
||
| Using an OrderedDict because I want to prune keys FIFO | ||
| """ | ||
| from scipy.optimize.nonlin import NoConvergence |
Creates a parameter that can be used in binaryops when corefineing. For instance, could allow you to fix a slab (in a different objective) as equal to the thickness of the freeform profile.
scipy.integrate.simps is now scipy.integrate.simpson
Added nSCFT, adapted from the work of Paul Kienzle (NIST) and Richard Sheridan.