Giter VIP home page Giter VIP logo

Comments (6)

jmmshn avatar jmmshn commented on July 26, 2024 1

So I think the custom as_dict for this takes precedence over the new general for the Enums

So something like this should work.

from monty.serialization import dumpfn
from enum import Enum
class Test(Enum):
    a = "a"
    b = "b"
t = Test.a
dumpfn(t, "test.json")

So I think if we just remove the custom as_dict and from_dict for that class then things should work. But we will have a see about the consequences.

from emmet.

jmmshn avatar jmmshn commented on July 26, 2024

Looks like I ran into something similar, resolved on monty's side:
materialsvirtuallab/monty#602

from emmet.

Andrew-S-Rosen avatar Andrew-S-Rosen commented on July 26, 2024

Oh that was smart! Thanks!! I'll check if is resolved with the monty update.

from emmet.

Andrew-S-Rosen avatar Andrew-S-Rosen commented on July 26, 2024

Looks like your PR didn't fix this one btw, @jmmshn. I'll have to dig into it later.

from emmet.

Andrew-S-Rosen avatar Andrew-S-Rosen commented on July 26, 2024

Thanks for the pointer, @jmmshn! Removing the .as_dict() method in emmet.core.utils.ValueEnum results in an AttributeError:

AttributeError: 'CrystalSystem' object has no attribute 'as_dict'

I'll dig into this later in the week. I think I know where to look now. 👍

from emmet.

Andrew-S-Rosen avatar Andrew-S-Rosen commented on July 26, 2024

@munrojm can you please re-open this? It won't let me do so. It needs to be reopened due to #974.

from emmet.

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.