Fleshing out the idea of a Simulation Controller object
Good progress
- All objects now register themselves with the simulation
- They all check the simulation when naming\
- There are some basic lookup, removal and addition methods
Commented out logger everywhere and good things are starting to happen
Trying to add save/load to sim object using just pickle...some odd thing happening
Everything seems to work!
- The save/load function is part of the Controller object
- It uses pickle which works perfectly
- One gotcha: the dicts are recreated in arbitrary order, so if the 'pore/throat.all' arrays were not first, then all preceeding arrays were rejected by the __setitem__ logic
- I created temporary workaround using a _loading attribute on every object.  I will try to be more elegant.
Upon loading, each object _sim is set to the loading sim
Removed the _loading attribute
- the __setitem__ now allows writing if the 'pore/throat.all' arrays are of zero length, which implies that an empty object is being populated.
This works, but not on custom classes.  Getting the object not the same as class error.
Merge branch 'develop' into feature/sim_layer
- Removed PNM save/load from IO.
- Create empty methods for export_to and import_from (note: I wanted to use import/export, but import is a python keyword)
Added a clone_object method to Controller...as I said, I can see many useful applications for a simulation controller.
Note: I kept the clone_object currently in misc since it's used by a few simulaitons, but it should be deprecated soon.
moved save_object and load_object to the Controller class
Logger Awesomeness
- The logger is now imported as a module as part of base (OpenPNM.Base.logging)
- To use it, each file must import OpenPNM.Base.logging as logging, then get an instance of the logger with logging.getLogger
- All Generic Classes now uses this approach
- Also set up the logger to inherit the names of the object that created it, including the inheritance tree, like Base -> Core -> net, so we know exactly where each message comes from
Reimplemented the logger in all objects
- Imported the logger at the top of every file that needs it
- uncommented everything and changed self._logger to just logger
Even more awesomeness!
- Formatted the logger to output the perfect message, including the calling class and function.
Added an 'expand' method to Controller that fills in all the objects in the simulation based on the connections in the object(s) it does have.
- The name of the method is up for debate.
Added docstrings to controller
Even better...
- All objects now register themselves with the same simulation object as part of the Base initialization process
- A handle to this simulation object can be reached with sim = pn.simulation
- Bonus: Controller is a singletons, so sim = OpenPNM.Base.Controller() returns the same object as pn.sim!  This means you can create your own handle to sim, or just fetch is after the fact.
Improved sim.load method to work nicer with the 'singleton' design
Added ability to output to VTK file from sim object.  This just calls the function in Utilities.IO.