Skip to content
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

Fixed the unit error in documentation of phonon.py #17

Merged
merged 5 commits into from
Jan 27, 2024

Conversation

rul048
Copy link
Contributor

@rul048 rul048 commented Jan 25, 2024

The unit is incorrect.

Summary

Major changes:

  • feature 1: ...
  • fix 1: ...

Todos

If this is work in progress, what else needs to be done?

  • feature 2: ...
  • fix 2:

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

The unit is incorrect.

Signed-off-by: Runze Liu <[email protected]>
free_energy: list of Helmholtz free energies at corresponding temperatures in eV,
entropy: list of entropies at corresponding temperatures in eV/K,
heat_capacity: list of heat capacities at constant volume at corresponding temperatures in eV/K^2,
free_energy: list of Helmholtz free energies at corresponding temperatures in KJ/mol,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! can you add a code comment with a link to where the units are documented?

Copy link
Contributor Author

@rul048 rul048 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just writing the comments and links here? Or it may affect the aesthetics of the source code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to insert the link where you think best

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ce513a2) 100.00% compared to head (74e8f11) 100.00%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          266       266           
=========================================
  Hits           266       266           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shyuep
Copy link
Contributor

shyuep commented Jan 25, 2024

Tests are also needed.

Add code comments with links to show where the units are documented originally.

Signed-off-by: Runze Liu <[email protected]>
@rul048
Copy link
Contributor Author

rul048 commented Jan 25, 2024

The units are documented in phonopy. See phonopy.Phonopy.run_thermal_properties() (https://github.com/phonopy/phonopy/blob/develop/phonopy/api_phonopy.py#L2591)
-> phonopy.phonon.thermal_properties.ThermalProperties.run() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L498)
-> phonopy.phonon.thermal_properties.ThermalPropertiesBase.run_free_energy(), run_entropy(), run_heat_capacity() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L217, #L233, #L225)

Delete previous comments that were too long.

Signed-off-by: Runze Liu <[email protected]>
@shyuep
Copy link
Contributor

shyuep commented Jan 27, 2024

The links should be in the code documentation itself. That does not affect the aesthetics of the code. It is more important that the documentation is clear. Otherwise it is hard for people to debug next time.

Add the comments and links.

Signed-off-by: Runze Liu <[email protected]>
Signed-off-by: Runze Liu <[email protected]>
@rul048
Copy link
Contributor Author

rul048 commented Jan 27, 2024

Important lesson professor, and thank you both.

The links should be in the code documentation itself. That does not affect the aesthetics of the code. It is more important that the documentation is clear. Otherwise it is hard for people to debug next time.

@shyuep shyuep merged commit bbd67ff into materialsvirtuallab:main Jan 27, 2024
6 checks passed
@rul048 rul048 deleted the patch-1 branch October 11, 2024 03:56
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

Successfully merging this pull request may close these issues.

3 participants