Giter VIP home page Giter VIP logo

Comments (7)

coltonbh avatar coltonbh commented on September 28, 2024 1

@VHchavez has your issue been fully addressed? Can I close now? Just doing some cleanup on old issues :) Thanks!

from qcelemental.

loriab avatar loriab commented on September 28, 2024

I'm not quite following your code. What is psi4geo -- str, psi4 Mol, etc.? The below works. I don't see how you're creating the qcel.models.Molecule object in your snippet.

import qcelemental as qcel

psi4geo = """
He 0 0 0
"""

molplot = qcel.models.Molecule.from_data(psi4geo).show()

print(molplot)

from qcelemental.

VHchavez avatar VHchavez commented on September 28, 2024

Ope, sorry about that. It is a psi4 geometry:

import psi4
# Using the function definition from above. 
benzene = psi4.geometry("pubchem:benzene")
molshow(benzene)

from qcelemental.

loriab avatar loriab commented on September 28, 2024

Ok, at first inspection, I didn't think your molshow would work at all. Inspecting further, psi4geo is taking the argument of self, and since the only operations on self in the show fn is to_string, and psi4.core.Molecule also has a to_string, your fn works.

Therefore, I think you could make a psi4molinstance.show() work by attaching it to the class like these other mol extensions. https://github.com/psi4/psi4/blob/master/psi4/driver/molutil.py#L227 It'd be good to also have a test case in the psi4 tests and a "using" fn for nglview in /tests/pytests/addons.py

from qcelemental.

VHchavez avatar VHchavez commented on September 28, 2024

Oh wow, that's pretty nifty! I've never added functions in this fashion. It works just fine 🐶.

Questions:

  1. To add the "using" test, do I need to simply add NGLview as a new key here?
  2. What would be an appropriate test? Assert that an nglview.widget.NGLWidget object gets returned?

Thanks.

from qcelemental.

loriab avatar loriab commented on September 28, 2024

To add the "using" test, do I need to simply add NGLview as a new key here?

Yes, that should work fine.

What would be an appropriate test? Assert that an nglview.widget.NGLWidget object gets returned?

Agreed, just check the type returned.

from qcelemental.

coltonbh avatar coltonbh commented on September 28, 2024

@VHchavez thank you!

from qcelemental.

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.