Skip to content

feat: getmuD UC3-4 #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yucongalicechen opened this issue May 2, 2025 · 1 comment
Open

feat: getmuD UC3-4 #181

yucongalicechen opened this issue May 2, 2025 · 1 comment

Comments

@yucongalicechen
Copy link
Collaborator

yucongalicechen commented May 2, 2025

Problem

The UCs for getmuD (pasted from #166):
UC1:

  1. User has sample composition, energy, and mass density and a target muD in mind, and wants to check the diameter.
  2. User provides this information labpdfproc.getmud (lpp.gm)
  3. lpp returns the target diameter

UC3:

  1. User specifies sample composition and energy.
  2. User provides this information labpdfproc.getmud (lpp.gm)
  3. lpp.gm computes mu for fully dense sample
  4. lpp.gm returns mu and mu/2

UC4:

  1. User has sample composition, energy, and packing fraction and a target muD in mind, and wants to check the diameter.
  2. User provides this information labpdfproc.getmud (lpp.gm)
  3. lpp returns the target diameter

For this issue we want to implement UC3-4 and we should have CLI apps for each UC.

Proposed solution

For UC3:
lpp defaults packing fraction to 0.5 and 1 and computes using the function in diffpyutils), so the code can be something like:

def estimate_mu(sample_composition, energy):
    mu1 = compute_mu_using_xraydb(sample_composition, energy, packing_fraction=0.5)
    mu2 = compute_mu_using_xraydb(sample_composition, energy, packing_fraction=1)
    return mu1, mu2

Implement this after we complete diffpy/diffpy.utils#331.

For UC4, we just need to add the tests (check test_estimate_diameter).

@yucongalicechen yucongalicechen added this to the 0.3.0 pre-release milestone May 2, 2025
@yucongalicechen yucongalicechen changed the title feat: getmuD UC3 feat: getmuD UC3-4 May 2, 2025
@sbillinge
Copy link
Contributor

looks good. I slightly modified UC3 based on our conversation. We have to decide an algorithm for computing mu when there are more than one phases returned by the database. There are different ways of doing it, we can discuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants