You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attributes, methods and docstrings for classes are discussed in #65.
I think the @property decorator can be easily introduced to extend the Molecule class further (for example by checking that all the element numbers are valid in the setter), in an advanced section.
Yes, that's what I was thinking. Instead of creating something from scratch to describe inheritance I think it's good to show that you can actually inherit from third-party libraries and avoid re-inventing the wheel.
This week I'm very busy, but I'll sketch out the advanced OOP section the coming weekend or next week.
Activity
RMeli commentedon May 4, 2020
@arm61 I can take this on with #23 if you want. I'll come up with a first ToC in the coming days so that we can agree on the general outline.
RMeli commentedon Jun 12, 2020
Attributes, methods and docstrings for classes are discussed in #65.
I think the
@propertydecorator can be easily introduced to extend theMoleculeclass further (for example by checking that all the element numbers are valid in the setter), in an advanced section.RMeli commentedon Jun 15, 2020
I suggest the following discussion for the advanced section:
@propertydecoratorself.elementsattribute with valid elements onlyMoleculeinherit fromSimpleMoleculeto avoid duplication of code (__init__method)Please let me know if other useful concepts should be added.
RMeli commentedon Jun 15, 2020
Scratch that. What about a short introduction to
networkxand show inheritance by deriving a molecule fromnetworkx.Graph?arm61 commentedon Jun 16, 2020
So using a graph network to describe a molecule?
RMeli commentedon Jun 16, 2020
Yes, something like A Minimal Molecule API, but simplified.
arm61 commentedon Jun 16, 2020
Not opposed to the idea. In particular, cause so much of Python is about building on top of other packages.
RMeli commentedon Jun 16, 2020
Yes, that's what I was thinking. Instead of creating something from scratch to describe inheritance I think it's good to show that you can actually inherit from third-party libraries and avoid re-inventing the wheel.
This week I'm very busy, but I'll sketch out the advanced OOP section the coming weekend or next week.
RMeli commentedon Jul 1, 2020
I was thinking of the following for the advanced section:
Moleculeclass__repr____len__and__getitem__to get atoms__iter__to loop over atoms (maybe too advanced if needs to introduce iterators?)@propertynetworkx.GraphDo you have any other suggestion on what should (or shouldn't) be included?