Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QML.jl problem #85

Closed
EmilSoleymani opened this issue Jun 20, 2022 · 5 comments
Closed

QML.jl problem #85

EmilSoleymani opened this issue Jun 20, 2022 · 5 comments

Comments

@EmilSoleymani
Copy link
Collaborator

When I try to pass Julia functions to QML, a very important part of the process, I get an error that says "Could not find module QML when looking up function get_julia_call". This was not present in my Julia Thermostat example. A quick google search lead me to this open issue which explains the problem. It seems to be related to module QML being present in the same directory. Since our vdisp.jl is in the vdisp/src/ folder, and our Project.toml is in vdisp/, the QML.jl module is not being found when I call the @qmlfunction macro.

@smiths
Copy link
Owner

smiths commented Jun 20, 2022

I hope the fix is as straightforward as changing the location of the Project.toml file.

@EmilSoleymani
Copy link
Collaborator Author

Although this issue wasn't solved by moving around files, I did find a workaround for what I initially wanted to do in commit 4e07de4. I hope this doesn't become a problem down the road.

@smiths
Copy link
Owner

smiths commented Jun 20, 2022

@EmilSoleymani is your concern related to setting the version of Julia to 1.0? I can see that being a concern, but at least it is a way to keep the software working in the future, at the potential cost of making it more difficult to update. Is anyone actively working on QML.jl? Can we hope that the original problem will be sorted out?

@EmilSoleymani
Copy link
Collaborator Author

I haven't tried reverting the Julia versions yet. I could give it a try, however, I did think of a permanent workaround. Instead of having to call a Julia function directly from QML files, we can have QML forward a "signal" to Julia to call on the function.

For example, we want to call the function f. In vdisp.jl we create callF. Using the Observable.jl library, we can set callF to Observable(false). This will initialize callF to false, and allow us to get a "signal" any time callF is changed thanks to the Observables.jl library. Once we recieve the signal that callF is changed, we call f() in our Julia code (and set callF back to false). If we need arguments we can also have a variable to store those.

@smiths
Copy link
Owner

smiths commented Jun 20, 2022

@EmilSoleymani I like that you found a potential work around. As long as it is documented, I think the observer design pattern could feel fairly natural here. It is hard to tell without seeing the code though. Do you think the observer pattern will be easy to maintain, or will it confuse people that work with the code in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants