Giter Club home page Giter Club logo

Comments (2)

spencerkclark avatar spencerkclark commented on June 2, 2024

I think this is my fault -- I think the issue is here in Model._set_mult_grid_attr. With the break keyword it looks like the loop will stop regardless after it tries the first external name. In addition, the way the body of the loop is currently written it looks like it will overwrite the attribute if the loop were allowed to run more than once (so you might end up with None attributes if you got rid of the break keyword).

Would something like this solve those two problems? Do we need to make sure that an attribute is set to None if it isn't found?

try:
    for name_int, names_ext in grid_attrs.items():
        for name in names_ext:
        # Rename all coordinates such that they match specified internal names.
        grid_attr = self._get_grid_attr(grid_objs, name)
        if grid_attr:
            renamed_attrs = self._rename_coords(grid_attr)
            setattr(self, name_int, renamed_attrs)
            break
        setattr(self, name_int, renamed_attrs)
except:
    raise

from aospy.

spencerahill avatar spencerahill commented on June 2, 2024

Yes this block is definitely the source of the problem. I actually coded up a fix along with some other fixes to Model that I'll push soon. Thanks!

from aospy.

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.