Skip to content

Commit

Permalink
Release of 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand authored Aug 29, 2023
2 parents 3a4f2d6 + 1dd3142 commit 5787836
Show file tree
Hide file tree
Showing 65 changed files with 92,309 additions and 1,854 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/cov-and-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: test-doc
on:
push:
branches:
- master
pull_request:
branches:
- master
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:

# Perform tests with coverage, build the doc and run the tests in the doc (only for python 3.8 on ubuntu)
test-cov-and-doc:
runs-on: ubuntu-latest
steps:
- name: "Checkout branch ${{ github.head_ref }}"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: "Set up Python on Ubuntu"
uses: actions/setup-python@v4
with:
python-version: 3.11
# Test Rust code
- name: "Test with coverage, build and test doc"
run: |
# Install virtualenv
pip install virtualenv
# Create and activate a new virtualenv
virtualenv mocpy-env
source mocpy-env/bin/activate
# For debug purpose (see dependencies)
cargo tree
# Install maturin
pip install maturin
# Build and install mocpy
maturin develop --release
# Install pytest-cov, needed to test with coverage
pip install -r requirements/tests.txt
pip install pytest-cov
# Run test with coverage and doctests
python -m pytest -v -s --doctest-modules python/mocpy --cov-report=term --cov=python/mocpy
# Install dependencies needed to build the docs
pip install -r requirements/docs.txt
sudo apt-get install pandoc
# Compile the docs and run the test examples
cd ./docs
# * Generate the HTML files
make html
deactivate
39 changes: 39 additions & 0 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: emscripten
on:
push:
branches:
- master
pull_request:
branches:
- master
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install pyodide-build
- shell: bash
run: |
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
echo PYTHON_VERSION=$(pyodide config get python_version | cut -d "." -f 1-2) >> $GITHUB_ENV
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: wasm32-unknown-emscripten
args: --release --out dist -i ${{ env.PYTHON_VERSION }}
sccache: 'true'
rust-toolchain: nightly
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wasm-wheels
path: dist
84 changes: 2 additions & 82 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: "Build and test wheels"
run: |
source $HOME/.cargo/env
for PYBIN in /opt/python/cp3[78910]*/bin; do
for PYBIN in /opt/python/cp{37,38,39,310,311}-*/bin; do
echo "Loop on PYBIN: $PYBIN"
# With maturin develop, we have to use virtualenv
"${PYBIN}/pip" install virtualenv
Expand All @@ -47,42 +47,6 @@ jobs:
rm -r mocpy-env/
done
test-linux32-wheels:
runs-on: ubuntu-latest
# CentOS 7 32 bits Docker Hub image that 'build-linux32-wheels' executes in.
# See https://github.com/pypa/manylinux for this particular container:
# * CPython 3.7, 3.8, 3.9, 3.10 and 3.11, installed in /opt/python/<python tag>-<abi tag>
env:
img: quay.io/pypa/manylinux2014_i686
steps:
- name: "Checkout branch ${{ github.head_ref }}"
uses: actions/checkout@v3
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v1
- name: Install dependencies
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
for PYBIN in /opt/python/cp3[78910]*/bin; do
echo "Loop on PYBIN: $PYBIN"
"${PYBIN}/pip" install virtualenv
"${PYBIN}/virtualenv" mocpy-env
source mocpy-env/bin/activate
pip install --upgrade pip
pip install maturin
maturin build --release --compatibility manylinux2014
maturin develop --release
pip install -r requirements/tests.txt
python -m pytest -v -s python/mocpy
pip freeze > requirements-uninstall.txt
pip uninstall -r requirements-uninstall.txt -y
deactivate
rm -r mocpy-env/
done'
test-macos-wheels:
runs-on: macOS-latest
strategy:
Expand Down Expand Up @@ -110,7 +74,7 @@ jobs:
pip install --upgrade pip
# Install and use maturin
pip install maturin
maturin build --release --universal2
maturin build --release --target universal2-apple-darwin
maturin develop --release
# Install dependencies
pip install -r requirements/tests.txt
Expand Down Expand Up @@ -154,47 +118,3 @@ jobs:
# Run tests
python -m pytest -v -s python\mocpy
deactivate
# Perform tests with coverage, build the doc and run the tests in the doc (only for python 3.8 on ubuntu)
test-cov-and-doc:
runs-on: ubuntu-latest
steps:
- name: "Checkout branch ${{ github.head_ref }}"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: "Set up Python on Ubuntu"
uses: actions/setup-python@v4
with:
python-version: 3.8
# Test Rust code
- name: "Test with coverage, build and test doc"
run: |
# Install virtualenv
pip install virtualenv
# Create and activate a new virtualenv
virtualenv mocpy-env
source mocpy-env/bin/activate
# For debug purpose (see dependencies)
cargo tree
# Install maturin
pip install maturin
# Build and install mocpy
maturin develop --release
# Install pytest-cov, needed to test with coverage
pip install -r requirements/tests.txt
pip install pytest-cov
# Run test with coverage
python -m pytest -v -s python/mocpy --cov-report=term --cov=python/mocpy
# Install dependencies needed to build the docs
pip install -r requirements/docs.txt
# Compile the docs and run the test examples
cd ./docs
# * Generate the HTML files
make html
# * Run the API test examples
make doctest
cd ..
# Switch off the virtualenv
deactivate
18 changes: 6 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default_language_version:
# force all unspecified python hooks to run python3.8
python: python3.8
# force all unspecified python hooks to run python3.10
python: python3.10
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -14,25 +14,20 @@ repos:
exclude_types:
- "svg"
description: "Remove trailing whitespaces"
# For Sphinx
- repo: https://github.com/pre-commit/pygrep-hooks
rev: 'v1.10.0'
hooks:
- id: rst-backticks
# Run Black on files
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
# Fast linter to replace flake8
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.247'
rev: 'v0.0.263'
hooks:
- id: ruff
fail_fast: true
# Same tools but for Jupyter notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
rev: 1.7.0
hooks:
- id: nbqa-black
name: nbqa-black
Expand All @@ -42,5 +37,4 @@ repos:
- id: nbqa-ruff
name: nbqa-ruff
description: "Run ruff on a Jupyter notebook"
fail_fast: true
- id: nbqa-isort
fail_fast: true
38 changes: 33 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,38 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [0.12.3]
## Memo on sections

* **Added** for new features.
* **Changed** for changes in existing functionality.
* **Deprecated** for soon-to-be removed features.
* **Removed** for now removed features.
* **Fixed** for any bug fixes.
* **Security** in case of vulnerabilities.

## [unreleased]

## [0.13.0]

### Added

* brand new support of frequency MOC ! :rocket:
* documentation has galleries of notebooks

### Changed

* `AbstractMOC.__init__` raises `PermissionError` if user tries to modify order manually
* `AbstractMOC.store_index_dtype` became `AbstractMOC._store_index_dtype` as is is intended for internal use only to handle 32 and 64b systems
* tests in doctrings now run in CI too
* CI won't run for linux 32 anymore, but support will still be provided upon bug repports

### Fixed

* `sum([moc1, moc2, moc3])` now works correctly (fixes #99)
* `MOC.wcs()` now works correctly for non-squared figures (fixes #98)
* `MOC.from_fits_image` now works even when the fits file has no CDELT (fixes #90)

## [0.12.3]

### Added

Expand All @@ -28,7 +59,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* :bug: return statement was missing in `MOC.uniq_hpx`


## [0.12.1]

### Added
Expand All @@ -46,7 +76,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* :bug: a bug was introduced in [0.12.0] on the functions `query_simbad` and `query_vizier_table` that are compatible with `pre_v2` format only
* :bug: when `max_depth=None` in `MOC.from_valued_cells`


## [0.12.0]

### Removed
Expand Down Expand Up @@ -77,7 +106,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* ⚠️ BREAKING: `times_to_microseconds` and `microseconds_to_times` moved from `utils` to `tmoc`.
* ⚠️ BREAKING: `uniq` removed from `IntervalSet`, but replacing method `uniq_hpx` added to `MOC`
+ ⚠️ BREAKING: the output of `uniq_hpx` is not sorted (but follow the order of the cells in the internal range list)
* ⚠️ BREAKING: the output of `uniq_hpx` is not sorted (but follow the order of the cells in the internal range list)
* ⚠️ BREAKING: `STMOC.query_by_time` now takes in input a `TimeMOC`
* ⚠️ BREAKING: `STMOC.query_by_space` now returns a `MOC`
* ⚠️ BREAKING: `TimeMOC.contains` does not take any longer a time resolution as input parameter
Expand Down Expand Up @@ -304,4 +333,3 @@ This method does not rely on astropy_healpix as there is for the moment no metho
* Notebooks have been updated and all the plots now use the new methods `fill` and `border`.
* A new package `spatial`, invisible from the user, but keeping all the code of spatial MOCs (plotting methods, border computation, special utils for creating WCS...) has been created. tmocs and core functions are still located in the root of the project.
* Add of a changelog

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "MOCPy"
version = "0.12.3"
version = "0.13.0"
authors = [
"Matthieu Baumann <[email protected]>",
"Thomas Boch <[email protected]>",
Expand Down Expand Up @@ -33,7 +33,7 @@ healpix = { package = "cdshealpix", version = "0.6" }
# healpix = { package = "cdshealpix", git = 'https://github.com/cds-astro/cds-healpix-rust', branch = 'master' }

[dependencies.numpy]
version = "0.18"
version = "0.17"

[dependencies.ndarray]
version = "0.15"
Expand All @@ -42,7 +42,7 @@ default-features = false # do not include the default features, and optionally
features = ["rayon"]

[dependencies.pyo3]
version = "0.18"
version = "0.17.3"
features = ["extension-module"]

[profile.release]
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ MOCPy
*****
|PyPI version| |Build/Test status| |Notebook Binder| |Doc|

MOCPy is a Python library allowing easy creation and manipulation of MOCs (Multi-Order Coverage maps).
MOCPy is a Python library allowing easy creation and manipulation of MOCs (Multi-Order Coverage maps).

MOC is an IVOA standard enabling description of arbitrary sky regions.
MOC is an IVOA standard enabling description of arbitrary sky regions.
Based on the HEALPix sky tessellation, it maps regions on the sky
into hierarchically grouped predefined cells.

An experimental support for TMOC (temporal MOC) has been added since version 0.4.0.
It allows creation, parsing and comparison of TMOCs.

Space & Time coverages (STMOC) are an extension of MOC to add time information.
It is possible to get a TMOC by querying a STMOC with a MOC and/or get a MOC
It is possible to get a TMOC by querying a STMOC with a MOC and/or get a MOC
by querying a STMOC with a TMOC.

Please check the mocpy's `documentation <https://cds-astro.github.io/mocpy/>`__
for more details about installing MOCPy and using it.

For a command line tool, see the `moc-cli <https://github.com/cds-astro/cds-moc-rust/tree/main/crates/cli>`__.
For a command line tool, see the `moc-cli <https://github.com/cds-astro/cds-moc-rust/tree/main/crates/cli>`__.

For more information about the MOCPy Rust core, see the `moc crate <https://crates.io/crates/moc>`__.
For more information about the MOCPy Rust core, see the `moc crate <https://crates.io/crates/moc>`__.

.. figure:: ./resources/readme.png
:scale: 50 %
Expand Down
Loading

0 comments on commit 5787836

Please sign in to comment.