Skip to content

Commit

Permalink
Merge pull request #6 from henrypinkard/main
Browse files Browse the repository at this point in the history
expose additional function
  • Loading branch information
henrypinkard authored Jul 16, 2024
2 parents 35df694 + c2eca23 commit 9a82c53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,27 @@ the python wrapper of the core (pymmcore)

`pip install mmpycorex`

## Programatically installing Micro-Manager
- Python utility functions for downloading and installing Micro-Manager
```python
from mmpycorex import download_and_install_mm, find_existing_mm_install

# this automatically installs the latest nightly build
# specify destination="your/custom/path", otherwise it will default to 'C:/Program files/Micro-Manager/'
# on windows or the home directory on mac
installed_path = download_and_install_mm()
```

## Accessing the Java core through python
```python
### Java Core example
from mmpycorex import create_core_instance, terminate_core_instances
from mmpycorex import create_core_instance, terminate_core_instances, get_default_install_location

# If micro-manager is alread running, you can get access to the core directly
# (just make sure the "run server" in the tools options dialog is checked)

# Otherwise you must create an instance of the Core in headless mode
mm_location = 'C:/Program files/Micro-Manager/'
mm_location = get_default_install_location() # 'C:/Program files/Micro-Manager/'
config_file = 'MMConfig_demo.cfg'
create_core_instance(mm_location, config_file, python_backend=False) # Create a remote MMCoreJ object

Expand All @@ -38,7 +49,7 @@ terminate_core_instances()
from mmpycorex import create_core_instance, terminate_core_instances

# Otherwise you must create an instance of the Core in headless mode
mm_location = 'C:/Program files/Micro-Manager/'
mm_location = get_default_install_location() # 'C:/Program files/Micro-Manager/'
config_file = 'MMConfig_demo.cfg'
create_core_instance(mm_location, config_file, python_backend=True) # Create pymmcore instance

Expand All @@ -50,16 +61,5 @@ core = Core()
terminate_core_instances()
```

## Utilities for programatically installing Micro-Manager
- Python utility functions for downloading and installing Micro-Manager
```python
from mmpycorex import download_and_install_mm, find_existing_mm_install

# this automatically installs the latest nightly build
# specify destination="your/custom/path", otherwise it will default to 'C:/Program files/Micro-Manager/'
# on windows or the home directory on mac
installed_path = download_and_install_mm()
```



2 changes: 1 addition & 1 deletion src/mmpycorex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

from .launcher import create_core_instance, terminate_core_instances, is_pymmcore_active
from .core import Core
from .install import download_and_install_mm, find_existing_mm_install
from .install import download_and_install_mm, find_existing_mm_install, get_default_install_location
2 changes: 1 addition & 1 deletion src/mmpycorex/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 3, 0)
version_info = (0, 3, 1)
__version__ = ".".join(map(str, version_info))

0 comments on commit 9a82c53

Please sign in to comment.