Skip to content

Bugfix/initial subgrade modulus api sand#39

Merged
TchilDill merged 3 commits intomainfrom
bugfix/initial_subgrade_modulus_api_sand
Apr 10, 2025
Merged

Bugfix/initial subgrade modulus api sand#39
TchilDill merged 3 commits intomainfrom
bugfix/initial_subgrade_modulus_api_sand

Conversation

@TchilDill
Copy link
Owner

@TchilDill TchilDill commented Apr 10, 2025

  • Sørensen sand and Kallehave sand py-curves implementation into openpile.soilmodels.API_sand() led to some minor bugs that are now corrected.

Summary by Sourcery

Fix implementation of Sørensen and Kallehave sand py-curves in API_sand() method

Bug Fixes:

  • Corrected the implementation of Sørensen and Kallehave sand py-curves in the API_sand() method
  • Fixed parameter naming from 'Modification' to 'modification' to match Python naming conventions
  • Updated initial subgrade modulus calculation for Sørensen and Kallehave modifications

Enhancements:

  • Improved parameter handling in the API_sand lateral soil model
  • Added more robust input validation for py-curve modifications

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 10, 2025

Reviewer's Guide by Sourcery

This pull request fixes bugs in the implementation of the Sørensen sand and Kallehave sand py-curves in the API_sand() method. It also updates the example notebook to reflect the corrected implementation. The changes involve correcting parameter naming, updating initial subgrade modulus calculation, improving parameter handling, and adding more robust input validation. The version of OpenPile is also updated from 1.0.0 to 1.0.1.

Sequence diagram for py_spring_fct with Kallehave modification

sequenceDiagram
    participant API_sand
    participant py_curves
    participant InitialSubgradeReaction

    API_sand->>API_sand: if self.modification == "Kallehave"
    API_sand->>InitialSubgradeReaction: kallehave_sand(phi, below_water_table, X, D)
    InitialSubgradeReaction-->>API_sand: k
    API_sand->>py_curves: api_sand(sig, X, D, kind, below_water_table, k, ymax, output_length)
    py_curves-->>API_sand: y, p
Loading

File-Level Changes

Change Details Files
Corrected the implementation of Sørensen sand and Kallehave sand py-curves in the API_sand() method.
  • Fixed parameter naming from 'Modification' to 'modification' to match Python naming conventions.
  • Updated initial subgrade modulus calculation for Sørensen and Kallehave modifications.
  • Improved parameter handling in the API_sand lateral soil model.
  • Added more robust input validation for py-curve modifications.
src/openpile/soilmodels.py
Updated the example notebook to reflect the corrected implementation of the Sørensen sand modification.
  • Changed the bottom elevation of the pile from -1 to -10.
  • Changed the diameter of the pile from 2.0 to 5.0.
  • Changed the lateral model to use the Sørensen modification.
  • Increased the point load along the y-axis from 1 to 1000.
samples/run_check_kernel.ipynb
Updated the version of OpenPile from 1.0.0 to 1.0.1.
  • Updated the version in src/openpile/__init__.py.
  • Added a changelog entry in CHANGELOG.md.
src/openpile/__init__.py
CHANGELOG.md
Added a lower bound to the X parameter in the sørensen2010_sand function.
  • Added X = max(X, 0.01) to the sørensen2010_sand function.
src/openpile/utils/hooks.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 51.92%. Comparing base (d8c8dcf) to head (c47bef6).

Files with missing lines Patch % Lines
src/openpile/soilmodels.py 25.00% 2 Missing and 1 partial ⚠️
src/openpile/utils/hooks.py 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   51.94%   51.92%   -0.02%     
==========================================
  Files          19       19              
  Lines        2953     2954       +1     
  Branches      355      355              
==========================================
  Hits         1534     1534              
- Misses       1333     1334       +1     
  Partials       86       86              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TchilDill TchilDill merged commit fe16b26 into main Apr 10, 2025
12 checks passed
@TchilDill TchilDill deleted the bugfix/initial_subgrade_modulus_api_sand branch August 9, 2025 12:02
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.

2 participants