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

Update trimesh requirement from <4.5,>=4 to >=4,<4.7 #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 27, 2025

Updates the requirements on trimesh to permit the latest version.

Release notes

Sourced from trimesh's releases.

Release 4.6.0

Release: Refactor Load Types (#2241)

A very common source of annoyance and confusion is that trimesh.load can return lots of different types depending on what type of file was passed (i.e. #2239). This refactor changes the return types for the loading functions to:

  • trimesh.load_scene -> Scene
  • This loads into a Scene, the most general container which can hold any loadable type. Most people should probably use this to load geometry.
  • trimesh.load_mesh -> Trimesh
  • Forces all mesh objects in a scene into a single Trimesh object. This potentially has to drop information and irreversibly concatenate multiple meshes.
  • The implementation of the concatenation logic is now in Scene.to_mesh rather than load.
  • trimesh.load_path -> Path
  • This loads into either a Path2D or Path3D which both inherit from Path
  • trimesh.load -> Geometry
  • This was the original load entry point and is deprecated, but there are no current plans to remove it. It has been modified into a thin wrapper for load_scene that attempts to match the behavior of the previous loader for backwards compatibility. In my testing against the current main branch it was returning the same types 99.8% of the time although there may be other subtle differences.
  • trimesh.load(..., force='mesh') will emit a deprecation warning in favor of load_mesh
  • trimesh.load(..., force='scene') will emit a deprecation warning in favor of load_scene

Additional changes:

  • Removes Geometry.metadata['file_path'] in favor of Geometry.source.file_path. Everything that inherits from Geometry should now have a .source attribute which is a typed dataclass. This was something of a struggle as file_path was populated into metadata on load, but we also try to make sure metadata is preserved through round-trips if at all possible. And so the load inserted different keys into the metadata. Making it first-class information rather than a loose key seems like an improvement, but users will have to replace mesh.metadata["file_name"] with mesh.source.file_name.
  • Moves all network fetching into WebResolver so it can be more easily gated by allow_remote.
  • Removes code for the following deprecations:
  • January 2025 deprecation for trimesh.resources.get in favor of the typed alternatives (get_json, get_bytes, etc).
  • January 2025 deprecation for Scene.deduplicated in favor of a very

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Summary by Sourcery

Enhancements:

  • Update the trimesh library to a version that supports new features, including a refactored loading API with type hints, and improved handling of metadata.

Updates the requirements on [trimesh](https://github.com/mikedh/trimesh) to permit the latest version.
- [Release notes](https://github.com/mikedh/trimesh/releases)
- [Commits](mikedh/trimesh@4.0.0...4.6.0)

---
updated-dependencies:
- dependency-name: trimesh
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jan 27, 2025
Copy link
Contributor

sourcery-ai bot commented Jan 27, 2025

Reviewer's Guide by Sourcery

This pull request updates the trimesh dependency to allow versions up to 4.7, from the previous upper bound of 4.5.

Class diagram showing updated trimesh loading functionality

classDiagram
    class Geometry {
      +source: Source
      +metadata: dict
      -deprecated file_path in metadata
    }
    class Scene {
      +to_mesh()
    }
    class Trimesh
    class Path {
    }
    class Path2D
    class Path3D

    Geometry <|-- Scene
    Geometry <|-- Trimesh
    Geometry <|-- Path
    Path <|-- Path2D
    Path <|-- Path3D

    note for Geometry "Changed: metadata['file_path'] moved to source.file_path"
    note for Scene "New: to_mesh() method for concatenation logic"
Loading

File-Level Changes

Change Details Files
Update trimesh dependency to allow versions up to 4.7.
  • Changed the upper bound of the trimesh dependency from <4.5 to <4.7.
pyproject.toml

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. Here's why:

  • It seems to have been created by a bot (hey, dependabot[bot]!). We assume it knows what it's doing!
  • We don't review packaging changes - Let us know if you'd like us to change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants