Giter Site home page Giter Site logo

Update hash_value about paramak HOT 2 CLOSED

billingsley-john avatar billingsley-john commented on August 26, 2024
Update hash_value

from paramak.

Comments (2)

billingsley-john avatar billingsley-john commented on August 26, 2024

UPDATE: hash_value can be calculated using self._dict_.values(). Note - _solid and _hash_value must not be calculated as part of the hash to prevent constant reconstruction.
This works well for parametric_shapes but there is a BUG when this propagates to parametric_components.

EXPECTED:

  • On first call of shape.solid, create_solid() should be called.
  • On second call of shape.solid, create_solid() should NOT be called IF no parameters have changed.

ACTUAL:

  • On first call of shape.solid, create_solid() is called. (EXPECTED)
  • On second call of shape.solid, create_solid() called again, despite no parameters being changed. (UNEXPECTED)
  • On third call of shape.solid, create_solid() is not called. (EXPECTED)

REASON:

  • shape.points = None upon class initialization/construction
  • First call of shape.solid doesn't seem to update shape.points correctly for the hash calculation
  • Therefore, second call of shape.solid compares new calculated points to None.
  • I.e. the point at which points is calculated in the solid construction chain and the point where the hash is calculated causes this issue.

from paramak.

billingsley-john avatar billingsley-john commented on August 26, 2024

FIX: Move hash_value calculation to AFTER solid construction. This allows shape.points to be populated correctly before the hash_value for the new solid is calculated.

from paramak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.