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

Develop branch updates in preparation for new release #308

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

AntObi
Copy link
Collaborator

@AntObi AntObi commented Aug 30, 2024

Develop branch updates in preparation for new release

Description

  • Bump version numbers to 2.7
  • Update metadata in setup.py
  • Preserve current SMACT default oxidation states in the attribute oxidation_states_smact14
  • Add warnings in documentation for smact_filter and smact_validity to alert users about changing defaults
  • General docstring fixes

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Reran tests locally to confirm changes do not break the existing test suite.

Test Configuration:

  • Python version: 3.10
  • Operating System: macOS

Reviewers

N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • New Features

    • Updated versioning to 2.7, indicating new enhancements or features.
    • Enhanced handling of oxidation states in the smact_filter and smact_validity functions to default to smact14.
  • Documentation

    • Improved clarity in function docstrings across various modules, specifying the handling of chemical formulas and oxidation states.
  • Bug Fixes

    • Corrected author information and email in project metadata for accuracy.
    • Resolved a typographical error in the maintainer's email variable.

Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The updates involve version increments in the docs/conf.py and setup.py files, reflecting a transition to version 2.7. Changes to the Element class in smact/__init__.py enhance oxidation state documentation and initialisation. The smact_filter and smact_validity functions in smact/screening.py now default to a new oxidation states setting. Documentation improvements across various files clarify function purposes and enhance code readability.

Changes

Files Change Summary
docs/conf.py, setup.py Version updated from 2.6 to 2.7, author information changed, maintainer email corrected, and date updated to August 30, 2024.
smact/__init__.py Documentation for oxidation states updated; streamlined initialisation logic for num_valence_modified.
smact/properties.py Docstring for valence_electron_count function modified for clarity.
smact/screening.py Default value for oxidation_states_set changed to "smact14" in smact_filter and smact_validity functions, with updated documentation.
smact/utils/composition.py Docstrings for parse_formula, comp_maker, and formula_maker functions enhanced for clarity; comp_maker logic refactored.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SMACT
    User->>SMACT: Request oxidation state processing
    SMACT->>SMACT: Use oxidation_states_smact14
    SMACT->>User: Return processed results
Loading

🐰 In the meadow, I hop with glee,
New changes bring joy, oh can’t you see?
Version two point seven, oh what a delight,
With clarity shining, everything feels right!
Hooray for the updates, let’s dance and play,
In the world of SMACT, it’s a wonderful day! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.46%. Comparing base (7b1f4f1) to head (6199001).
Report is 10 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #308      +/-   ##
===========================================
- Coverage    76.55%   76.46%   -0.09%     
===========================================
  Files           26       26              
  Lines         2273     2265       -8     
===========================================
- Hits          1740     1732       -8     
  Misses         533      533              

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7b1f4f1 and 6199001.

Files selected for processing (6)
  • docs/conf.py (1 hunks)
  • setup.py (2 hunks)
  • smact/init.py (3 hunks)
  • smact/properties.py (2 hunks)
  • smact/screening.py (6 hunks)
  • smact/utils/composition.py (3 hunks)
Files skipped from review due to trivial changes (2)
  • docs/conf.py
  • smact/properties.py
Additional comments not posted (20)
setup.py (5)

3-3: Author updated to collective representation.

The change to "The SMACT Developers" reflects a broader authorship, which is appropriate for collaborative projects.


4-4: Author email updated to match new author representation.

The update to "[email protected]" aligns with the new author representation, ensuring consistency in contact details.


8-8: Version number incremented appropriately for new release.

The update to "2.7" is consistent with the PR's objective of preparing for a new release.


10-10: Corrected typographical error in maintainer's email variable name.

The correction from __maintaier_email__ to __maintainer_email__ resolves a previous typographical error, enhancing the code's accuracy and maintainability.


11-11: Date updated to reflect the latest modification.

The update to "August 30, 2024" ensures that the metadata reflects the most current modification date.

smact/utils/composition.py (3)

14-14: Docstring updated for clarity in parse_formula.

The updated docstring enhances understanding by clearly stating that the function parses a chemical formula into a dictionary of elements and their amounts.


59-59: Docstring updated for clarity in comp_maker.

The updated docstring improves documentation by clearly describing the function's purpose and the structure of its input, enhancing usability and understanding.


74-81: Refactoring in comp_maker enhances readability.

The use of dictionary comprehension in lines 74-81 improves the readability and conciseness of the code, maintaining the same functionality while making it more elegant.

smact/__init__.py (3)

56-56: New attribute Element.oxidation_states_smact14 added for clarity.

The addition of Element.oxidation_states_smact14 provides clear documentation of the default oxidation states used in SMACT versions prior to 3.0, enhancing the historical context and usability of the library.


58-60: Updated descriptions for oxidation states enhance documentation accuracy.

The updates to the descriptions of Element.oxidation_states_sp and Element.oxidation_states_icsd provide more precise information about their sources and versions, improving the accuracy and usefulness of the documentation.


170-172: Streamlined assignment for num_valence_modified enhances readability.

The use of an inline conditional expression in lines 170-172 simplifies the assignment logic for num_valence_modified, improving the readability and maintainability of the code without altering its functionality.

smact/screening.py (9)

324-324: Update default oxidation state parameter.

The default value for oxidation_states_set has been changed from "default" to "smact14". This aligns with the PR objectives to update default settings and should be clearly communicated to users to manage expectations regarding backward compatibility.


331-334: Document backward compatibility concerns.

The warning added here is crucial for informing users about the changes in default oxidation states in upcoming versions. It's well-placed and clearly states the implications for users upgrading from older versions.


340-340: Clarify available options for oxidation states.

The documentation here is enhanced to list all available options for the oxidation_states_set parameter. This is a positive change as it improves clarity and user understanding of the function's capabilities.


380-380: Map oxidation states to elements.

This mapping ensures that the correct oxidation states are used based on the oxidation_states_set parameter. It's a crucial part of the function's logic to ensure accurate chemical analysis.


392-392: Handle invalid oxidation states input.

The exception handling here is robust, providing clear feedback to the user when an invalid oxidation states set is specified. This prevents runtime errors and guides users towards correct usage.


437-437: Update default oxidation state parameter in smact_validity.

Similar to smact_filter, the default for oxidation_states_set is updated to "smact14". Consistency in default parameters across functions is good practice and helps in maintaining predictable behaviour.


443-446: Document backward compatibility concerns in smact_validity.

The warning added is identical to that in smact_filter, maintaining consistency in how changes are communicated across functions. This helps in setting the right expectations for users about the upcoming changes.


452-453: Clarify available options for oxidation states in smact_validity.

The documentation here mirrors the changes made in smact_filter, enhancing consistency and clarity across the codebase. This is beneficial for users who need to understand the implications of their parameter choices.


Line range hint 482-502: Implement oxidation states selection logic in smact_validity.

The logic here is similar to that in smact_filter, ensuring that the correct oxidation states are used based on the user's choice. The exception handling for invalid inputs is also consistent, which is crucial for preventing errors and guiding users.

@AntObi AntObi merged commit d440b16 into WMD-group:develop Aug 30, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant