Giter Club home page Giter Club logo

Comments (1)

steveri avatar steveri commented on August 15, 2024

More information: I drilled down and maybe narrowed the problem to the ['_abc_impl'] component of the bit:
Example code:

import magma as m
import pickle

bit = m.In(m.Bit)
d = bit.__dict__
print(d)
pickle.dumps(d['_abc_impl'])

Example result of running code:

{
  'orig_name': 'Bit',
  '_info_': (Bit, <Direction.In: 0>),
  '__module__': 'magma.bit',
  '__doc__': None,
  '__abstractmethods__': frozenset(),
  '_abc_impl': <_abc_data object at 0x7f24490023f0>
}
Traceback (most recent call last):
  File "simple-example.py", line 7, in <module>
    pickle.dumps(d['_abc_impl'])
TypeError: cannot pickle '_abc_data' object

The error cannot pickle '_abc_data' object is a known long-standing problem with pickle, but they claim to have solved it: uqfoundation/dill#332

I tried their example (below) and did not get the error, so I guess they think it's fixed. But ours is still broken.

import dill
from abc import ABCMeta

class AbstractClass(metaclass=ABCMeta):
  pass

class ConcreteClass(AbstractClass):
  pass

dill.dumps(ConcreteClass)

The next step (if I were doing this) would be to find what's different between our abstract class and their example, and either fix our code or update their bug report. But I'm moving on to something else, so I'm hoping someone else might take up the cause...

from magma.

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.