Context managers and default sessions #4050
              
  
  Closed
              
          
                  
                    
                      seanpearsonuk
                    
                  
                
                  started this conversation in
                Ideas
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion covers two related topics that intersect in user experience and API ergonomics:
Managing a default Fluent session in PyFluent
Using a context manager to temporarily switch sessions
Here's a preview of what this might look like in use:
Requirements
using(session)context manager to control the active solver session.settings_source.Advantages
Viscous(),BoundaryConditions(), etc.) without boilerplate.Drawbacks
Notes
While these two ideas — context-managed session switching and implicit default session management — complement each other, they can be considered independently. In particular, context management could be useful even without a default session.
Beta Was this translation helpful? Give feedback.
All reactions