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

Installation issues #13

Open
vstadnytskyi opened this issue Jul 21, 2019 · 6 comments
Open

Installation issues #13

vstadnytskyi opened this issue Jul 21, 2019 · 6 comments

Comments

@vstadnytskyi
Copy link

I would appriciate if someone can help me isntalling it. My in-home developed microfluidic device doesn't behave as expected and I hoped to figure out why using the tool you developed. However, I am getting stuck with isntallation on my Mac Mojave computer. I have followed the installtion instructions (https://github.com/manifold-lang/pymanifold) and completed the first step. However, I cannot find where the docker put the image, hence, I cannot proceed to the next step. The root folder for the docker doesn't exist. (see below)

user:bin user-13$ docker info
...
Docker Root Dir: /var/lib/docker
...
user:/ user-13$ cd var/lib/docker
-bash: cd: var/lib/docker: No such file or directory

I also tried to instal dRea4l solver but got stuck as well.

user:dreal4 user-13$ bazel build //... --apple_generate_dsym
ERROR: /private/var/tmp/_bazel_femto-13/9101c4b47559e9f49ae7e434f8129424/external/local_config_cc/BUILD:62:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, verify that "xcode-select -p" is correct and then try: "bazel shutdown" to re-run Xcode configuration
ERROR: Analysis of target '//dreal/api:api_test' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
INFO: Elapsed time: 0.177s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

I have asked part of this question on Stackoverflow as well https://stackoverflow.com/questions/57134462/the-location-where-are-docker-images-stored-on-the-host-machine-doesnt-exist

@vstadnytskyi
Copy link
Author

vstadnytskyi commented Jul 21, 2019

I have made some progress. I have figured how to install dReal4. However, the 'Variables' seems to be missing from dReal4.

femto13:microfluidics femto-13$ ipython3
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)

Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pymanifold
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2bb352dc2fb6> in <module>
----> 1 import pymanifold

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymanifold/__init__.py in <module>
----> 1 from pymanifold.pymanifold import Schematic

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymanifold/pymanifold.py in <module>
      7 #  from build.lib.data.dreal.symbolic import Variable, logical_and, sin, cos
      8 #  from build.lib.data.dreal.api import CheckSatisfiability, Minimize
----> 9 from dreal.symbolic import Variable, logical_and, sin, cos
     10 from dreal.api import CheckSatisfiability, Minimize
     11 #  from pysmt.typing import REAL

ImportError: cannot import name 'Variable' from 'dreal.symbolic' (unknown location)

@jsreid13
Copy link
Collaborator

Hey @vstadnytskyi ! As long as you have pulled the docker image you should be able to run pyManifold without needing to install dReal4 as it is inside the docker image.

I believe the confusion is around what i meant by root folder, for that I mean the root for of this repository. So in order to run the tests, you need to first clone this repository with git clone https://github.com/manifold-lang/pymanifold.git on your computer, then navigate to the pymanifold folder that is created and run the command docker container run -it --rm -v $(pwd):/tmp -v $(pwd)/src:/tmp/src -w /tmp -e PYTHONPATH=/tmp jsreid13/pymanifold python3 tests/t_junction_test.py

In order to model your system, you can create your own script similar to t_junction_test.py that uses the dimensions of your system. If you have any other questions feel free to ask, I understand the documentation for this is limited so I'll try to help out however I can!

@vstadnytskyi
Copy link
Author

The import of Variable works if it is done directly from dreal

see my question here. dreal/dreal4#145

In [7]: from dreal import Variable

In [8]: Variable.__dict__
Out[8]:
mappingproxy({'__init__': <instancemethod __init__ at 0x1119faeb8>,
              '__doc__': None,
              '__module__': 'dreal._dreal_py',

              'get_id': <instancemethod get_id at 0x1119faee8>,
              'get_type': <instancemethod get_type at 0x1119faf48>,
              '__str__': <instancemethod __str__ at 0x1119fafa8>,
              '__repr__': <instancemethod __repr__ at 0x1119f7048>,
              '__hash__': <instancemethod __hash__ at 0x1119f70a8>,
              '__add__': <instancemethod __add__ at 0x1119f7138>,
              '__radd__': <instancemethod __radd__ at 0x1119f7168>,
              '__sub__': <instancemethod __sub__ at 0x1119f71f8>,
              '__rsub__': <instancemethod __rsub__ at 0x1119f7228>,
              '__mul__': <instancemethod __mul__ at 0x1119f72b8>,
              '__rmul__': <instancemethod __rmul__ at 0x1119f72e8>,
              '__truediv__': <instancemethod __truediv__ at 0x1119f7378>,
              '__rtruediv__': <instancemethod __rtruediv__ at 0x1119f73a8>,
              '__pow__': <instancemethod __pow__ at 0x1119f7408>,
              '__pos__': <instancemethod __pos__ at 0x1119f7468>,
              '__neg__': <instancemethod __neg__ at 0x1119f74c8>,
              '__lt__': <instancemethod __lt__ at 0x1119f7528>,
              '__le__': <instancemethod __le__ at 0x1119f7588>,
              '__gt__': <instancemethod __gt__ at 0x1119f75e8>,
              '__ge__': <instancemethod __ge__ at 0x1119f7648>,
              '__eq__': <instancemethod __eq__ at 0x1119f76a8>,
              '__ne__': <instancemethod __ne__ at 0x1119f7708>,
              'Type': dreal._dreal_py.Variable.Type,
              'Real': Type.Real,
              'Int': Type.Int,
              'Bool': Type.Bool,
              'Binary': Type.Binary})

@vstadnytskyi
Copy link
Author

vstadnytskyi commented Jul 21, 2019

Hey @vstadnytskyi ! As long as you have pulled the docker image you should be able to run pyManifold without needing to install dReal4 as it is inside the docker image.

I believe the confusion is around what i meant by root folder, for that I mean the root for of this repository. So in order to run the tests, you need to first clone this repository with git clone https://github.com/manifold-lang/pymanifold.git on your computer, then navigate to the pymanifold folder that is created and run the command docker container run -it --rm -v $(pwd):/tmp -v $(pwd)/src:/tmp/src -w /tmp -e PYTHONPATH=/tmp jsreid13/pymanifold python3 tests/t_junction_test.py

In order to model your system, you can create your own script similar to t_junction_test.py that uses the dimensions of your system. If you have any other questions feel free to ask, I understand the documentation for this is limited so I'll try to help out however I can!

It worked after I cloned it.
Valentyns-MacBook-Pro:pymanifold femto-13$ docker container run -it --rm -v $(pwd):/tmp -v $(pwd)/src:/tmp/src -w /tmp -e PYTHONPATH=/tmp jsreid13/pymanifold python3 tests/t_junction_test.py

But I know I want to import pymanifold into my script and build something else using this library.

I got it running but I have no idea how to customize the code to fit my design. Also, I was planning to use this package to simulate nano-droplet generation. Is it possible or does it just take care of laminar flow of fluids in capilaries? Has this code been used and described in any papers?

@jsreid13
Copy link
Collaborator

It has not been tested for nano-droplet generation, but I have tested it in collaboration with the droplet generation performed in this work https://www.mdpi.com/2072-666X/9/5/215 . It handles the laminar flow of fluids for droplet generation as outlined in the equations from this paper https://pubs.rsc.org/en/content/articlelanding/2010/LC/c002625e . This project was created for my Master's thesis which will be published in a couple weeks which will describe the code for this simulation.

@vstadnytskyi
Copy link
Author

@jsreid13 Looking forward to read your thesis!

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