#!/usr/bin/env python # coding: utf-8 # In[1]: import chemcoord as cc # # Settings # Settings can be seen here: # In[2]: cc.configuration.settings # A configuration file can be written with: # In[3]: cc.configuration.write_configuration_file('./example_configuration_file', overwrite=True) # In[4]: get_ipython().run_line_magic('less', 'example_configuration_file') # It is read automatically during startup from ``'~/.chemcoordrc'``. # Otherwise it is possible to explicitly call ``cc.configuration.read_configuration_file(...)`` # In[5]: get_ipython().system('rm example_configuration_file') # # Inheritance # # You can safely inherit from the classes in this module # In[6]: class my_tailored_class(cc.Cartesian): def my_number_one_method(self): return 1 # In[7]: molecule = cc.Cartesian.read_xyz('MIL53_small.xyz') type(molecule) # Notice how all old methods from Cartesian return an object of your tailored class # In[8]: my_molecule = my_tailored_class.read_xyz('MIL53_small.xyz') type(my_molecule) # In[9]: type(my_molecule.get_inertia()['transformed_Cartesian']) # In[10]: my_molecule.get_inertia()['transformed_Cartesian'].my_number_one_method() # In[ ]: