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

Merge latest dev #224

Merged
merged 27 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e8c9297
clear gmsh between initializations
emjoyce Oct 6, 2023
acdad27
Create python-package-conda.yml
gouwens Feb 20, 2024
37cc245
Update python-package-conda.yml
gouwens Feb 20, 2024
d8a7301
Update python-package-conda.yml
gouwens Feb 20, 2024
1439c25
Update python-package-conda.yml
gouwens Feb 20, 2024
a7589b3
Update python-package-conda.yml
gouwens Feb 20, 2024
5104c3b
Update python-package-conda.yml
gouwens Feb 20, 2024
879a30c
Update test_post_data_to_s3.py
gouwens Feb 20, 2024
11080e1
Update python-package-conda.yml
gouwens Feb 20, 2024
9e7f584
Update python-package-conda.yml
gouwens Feb 20, 2024
59a2df5
Update layer_histogram.py
gouwens Feb 20, 2024
b07631a
Update mark.py
gouwens Feb 20, 2024
27372bd
Merge pull request #220 from emjoyce/dev
fcollman Apr 23, 2024
c460417
Create publish.yml
gouwens Apr 29, 2024
81dda60
Merge pull request #222 from AllenInstitute/dev
gouwens Apr 29, 2024
25be120
Update python-package-conda.yml
gouwens Apr 29, 2024
71707e4
Update python-package-conda.yml
gouwens Apr 29, 2024
0603e56
Update python-package-conda.yml
gouwens Apr 29, 2024
3361938
Update python-package-conda.yml
gouwens Apr 29, 2024
2518234
Update python-package-conda.yml
gouwens Apr 29, 2024
7baf19a
Update python-package-conda.yml
gouwens Apr 29, 2024
85903bc
Update python-package-conda.yml
gouwens Apr 29, 2024
5c16d7a
Update python-package-conda.yml
gouwens Apr 29, 2024
3b42675
Update README.md
gouwens Apr 29, 2024
5ac3af2
Update README.md
gouwens Apr 29, 2024
e4f15fe
Update README.md
gouwens Apr 29, 2024
e597e25
Merge pull request #223 from AllenInstitute/gouwens-migrate-actions
gouwens Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U twine setuptools wheel

- name: build release distributions
run: |
python setup.py sdist
python setup.py bdist_wheel

- name: upload windows dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
84 changes: 84 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Python Package using Conda

on: [push]

jobs:
build-windows:
runs-on: windows-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install dependencies
run: |
C:\Miniconda\condabin\conda.bat install tqdm openjpeg ruamel.yaml
python -m pip install --upgrade pip
pip install -r test_requirements.txt -U
pip install -r requirements.txt -U
pip install -e .
- name: Test with pytest
run: |
python -m pytest tests/

build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install dependencies
run: |
conda install tqdm openjpeg ruamel.yaml
python -m pip install --upgrade pip
pip install -r test_requirements.txt -U
pip install -r requirements.txt -U
pip install -e .
- name: Lint with flake8
run: |
# flake8 already installed via test_requirements.txt
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest tests/

build-mac:
runs-on: macos-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
- name: Install dependencies
run: |
conda install tqdm openjpeg ruamel.yaml
brew install hdf5
export HDF5_DIR="$(brew --prefix hdf5)"
python -m pip install --upgrade pip
pip install -r test_requirements.txt -U --disable-pip-version-check
pip install -r requirements.txt -U --disable-pip-version-check
pip install -e . --disable-pip-version-check
- name: Test with pytest
run: |
python -m pytest tests/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Documentation Status](https://readthedocs.org/projects/neuron-morphology/badge/?version=latest)](https://neuron-morphology.readthedocs.io/en/latest/?badge=latest) [![Allen Institute](https://circleci.com/gh/AllenInstitute/neuron_morphology.svg?style=svg)](https://app.circleci.com/pipelines/github/AllenInstitute/neuron_morphology) [![Build status](https://ci.appveyor.com/api/projects/status/7fekclwnq58p61ax?svg=true)](https://ci.appveyor.com/project/fcollman/neuron-morphology)

[![Documentation Status](https://readthedocs.org/projects/neuron-morphology/badge/?version=latest)](https://neuron-morphology.readthedocs.io/en/latest/?badge=latest)
![build workflow](https://github.com/alleninstitute/neuron_morphology/actions/workflows/python-package-conda.yml/badge.svg)

neuron_morphology
=================
Expand Down
2 changes: 1 addition & 1 deletion neuron_morphology/feature_extractor/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RequiresRelativeSomaDepth(Mark):

@classmethod
def validate(cls, data: Data) -> bool:
return data.morphology.has_type(RELATIVE_SOMA_DEPTH)
return data.morphology.has_type(SOMA)

class RequiresSoma(Mark):
"""Indicates that these features require a soma."""
Expand Down
2 changes: 1 addition & 1 deletion neuron_morphology/features/layer/layer_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def ensure_tuple(
raise ValueError("if_none must be a tuple or \"raise\"")

if inputs is None:
if if_none is "raise":
if if_none == "raise":
raise ValueError("inputs were None")
else:
return if_none # type: ignore[]
Expand Down
1 change: 1 addition & 0 deletions neuron_morphology/transforms/streamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def generate_laplace_field(top_line: List[Tuple],

# Create mesh with gmsh
gmsh.initialize()
gmsh.clear()

# Set up the points
point_tags = [gmsh.model.geo.addPoint(x, y, 0, meshSize=mesh_res)
Expand Down
4 changes: 2 additions & 2 deletions tests/pipeline/test_post_data_to_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import boto3
import zipfile
from moto import mock_s3
from moto import mock_aws
import unittest

from neuron_morphology.pipeline.post_data_to_s3 import post_object_to_s3, zip_files
Expand Down Expand Up @@ -35,7 +35,7 @@ def test_zip_files(self):

self.assertListEqual(self.mock_listing, file_list)

@mock_s3
@mock_aws
def test_post_data_to_s3(tmpdir_factory):

temp_output_dir = str(tmpdir_factory.mktemp("test"))
Expand Down
Loading