Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 36 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
py-version:
- '3.11' # Oldest supported
- '3.14' # Latest stable
name: Python ${{ matrix.py-version }}
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Use Python ${{ matrix.py-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.py-version }}
architecture: x64

- name: Install SCIMES
run: |
pip install -r pip-requirements
pip install .

- name: Run tests
run: |
# use pytest -vv -x for debugging
pytest tests
339 changes: 0 additions & 339 deletions LICENSE

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions pip-requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ astropy>=1.0.2
matplotlib>=1.4.0
astrodendro>=0.1.0
scikit-learn>=0.15.2
pytest
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name="SCIMES"
dynamic = ["version"]
description="Spectral Clustering for Interstellar Molecular Emission Segmentation"
readme = "README.md"
authors = [
{ name = "Dario Colombo", email = "dario.colombo222@gmail.com"},
{ name = "Erik Rosolowsky"},
{ name = "Adam Ginsburg"},
{ name = "Ana Duarte-Cabral"},
{ name = "Annie Hughes"},
]
maintainers = [
{ name = "Dario Colombo", email = "dario.colombo222@gmail.com"},
]
# license = "BSD"
# license-files = ["licences/LICENCE.rst"]
keywords = [
]
classifiers=[
]

requires-python = ">=3.11"

dependencies = [
"numpy",
"scipy",
"matplotlib",
"astropy",
"scikit-learn",
"tqdm",
"pytest",
]

[project.urls]
Homepage = "http://scimes.readthedocs.org/"
Repository = "https://github.com/Astroua/SCIMES"

[tool.setuptools.packages.find]
where = ["src"]
7 changes: 1 addition & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ all_files = 1
upload-dir = docs/_build/html
show-response = 1

[pytest]
minversion = 2.2
norecursedirs = build docs/_build
doctest_plus = enabled

[ah_bootstrap]
auto_use = True

Expand All @@ -21,7 +16,7 @@ description = Spectral Clustering for Interstellar Molecular Emission Segmentati
long_description = Molecular Gas Structure Identification via Dendrogram and Spectral Clustering
author = Dario Colombo, Erik Rosolowsky, Adam Ginsburg, Ana Duarte-Cabral, and Annie Hughes
author_email = dario.colombo222@gmail.com
license = BSD
# license = BSD
url = http://scimes.readthedocs.org/
edit_on_github = True
github_project = Astroua/SCIMES
128 changes: 0 additions & 128 deletions setup.py

This file was deleted.

2 changes: 2 additions & 0 deletions scimes/__init__.py → src/scimes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

from .scimes import *

__version__ = "0.3.2"

"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions scimes/plotting.py → src/scimes/plotting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from matplotlib import pyplot as plt
import itertools

def dendroplot_clusters(clusters,
dend,
Expand Down
4 changes: 3 additions & 1 deletion scimes/scimes.py → src/scimes/scimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
from astropy.table import Column
from sklearn.metrics import silhouette_score
#from sklearn.manifold import spectral_embedding
from .old_spectral_embedding import spectral_embedding
from scimes.old_spectral_embedding import spectral_embedding
from sklearn.cluster import k_means

__all__ = ['mat_smooth', 'aff_matrix', 'guessk', 'clust_cleaning', 'make_asgncube'] # TODO: complete API

def mat_smooth(Mat, S2Nmat, s2nlim = 3, scalpar = None, lscal = False):
"""
Estimate the scaling parameter and rescale
Expand Down
7 changes: 7 additions & 0 deletions tests/dummy_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest

def test_dummy(): # pytest automatically calls functions with name starting with test
assert True

def test_dummy_failing():
assert False
22 changes: 22 additions & 0 deletions tests/test_installation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest

def test_import():
try:
import scimes
scimes_importable = True
except ImportError:
scimes_importable = False
assert scimes_importable, 'Cannot import SCIMES at all!'

def test_function_import():
# we want to be able to import functions like this
from scimes import mat_smooth

# test for all of them
import scimes
from scimes.scimes import __all__ as API
for name in API:
assert getattr(scimes, name) is not None, f'Cannot `from scimes import {name}`'


from scimes.plotting import dendroplot_clusters