Skip to content

Commit

Permalink
fix for githuworkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RRobert92 committed May 9, 2024
1 parent 018638b commit 0cda384
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/publish_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
conda_deployment_with_new_tag:
name: Conda deployment of package with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v1
- name: publish-to-conda
uses: MichaelsJP/conda-package-publish-action@v1.0.0
with:
subDir: 'conda-build'
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }}
platforms: 'all'
override: true
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: conda-build/conda_build_config.yml
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Build and upload the conda packages
uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0
with:
meta_yaml_dir: conda-build
python-version: ${{ matrix.python-version }}
platform_linux-64: true
platform_osx-64: true
platform_win-64: true
user: RRobert92
label: auto
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret
1 change: 0 additions & 1 deletion conda-build/conda_publish_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- scikit-learn>1.0.1
- scikit-image>0.19.2
- scipy>=1.8.1
- edt>=2.3.0
- pillow>10.0.0
- open3d>=0.9.0
- requests>2.28.0
Expand Down
1 change: 0 additions & 1 deletion conda-build/meta-v0.2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ build:
number: 0
script: "{{ PYTHON }} setup.py install --single-version-externally-managed --record=record.txt"


about:
home: https://github.com/SMLC-NYSBC/TARDIS
license: MIT
Expand Down
3 changes: 3 additions & 0 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Tutorials

`4. Visualize Instance segmentation results <usage/visualization.html>`__
-------------------------------------------------------------------------

`4. Helper functions <usage/helper.html>`__
-------------------------------------------------------------------------
2 changes: 2 additions & 0 deletions docs/usage/helper.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Helper functions
----------------
20 changes: 19 additions & 1 deletion tardis_em/scripts/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import click
import numpy as np
from tardis_em.utils.visualize_pc import VisualizeFilaments, VisualizePointCloud
from tardis_em.utils.load_data import ImportDataFromAmira
from tardis_em.utils.load_data import ImportDataFromAmira, load_mrc_file
from tardis_em._version import version


Expand Down Expand Up @@ -63,6 +63,24 @@ def main(dir_: str, _2d: bool, type_: str, animate: bool, with_node: bool):
pc = ImportDataFromAmira(dir_).get_segmented_points()
elif dir_.endswith(".npy"):
pc = np.load(dir_)
elif dir_.endswith(".mrc"):
pc, _ = load_mrc_file(dir_)
if pc.min() == 0 and pc.max() == 1:
pc = np.array(np.where(pc > 0)).T
else:
idx_ = np.unique(pc)

px_df = []
for i in idx_:
if i == 0:
continue

i_ = np.array(np.where(pc == i)).T
px_df.append(
np.hstack((np.repeat(i, len(i_))[:, None], i_))
)

pc = np.vstack(px_df)

if type_ == "p":
if pc.shape[1] == 4 or pc.shape[1] == 3 and _2d:
Expand Down

0 comments on commit 0cda384

Please sign in to comment.