GithubHelp home page GithubHelp logo

Comments (3)

ilianasiriziba avatar ilianasiriziba commented on July 28, 2024

Hi @armantekinalp

In the latest version of the restart example, I fixed the order for imports. If you check that it imports utils first. I also run the example again and it is working fine.

from sopht.

sy-cui avatar sy-cui commented on July 28, 2024

Hi @ilianasiriziba .

You are right. At the moment most case files should be working. However, a simple way to recreate the issue is to have a new file with the following lines

import sopht.simulator as sps
import sopht.utils as spu

This will cause a circular import error because spu is imported within some sps files, while restart_sim also imports some of the sps objects.

I think a easy fix is to remove all references to flow simulator related types (or anything related to sps for that matter) within restart_sim.py, and return the current time from the function

def restart_simulation(
    # No flow_sim here
    ...
):
    ...
    curr_time = io.load(...)
    ...
    return curr_time

then in case files (restart_example.py, for example) correct the flow simulator time

time = restart_simulation(...)
flow_sim.time = time

This avoid import sps members inside an spu file. @ilianasiriziba do you want to try this an confirm if it works?

from sopht.

ilianasiriziba avatar ilianasiriziba commented on July 28, 2024

Hi @sy-cui

Sure, I'll try this and let you know.

from sopht.

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.