Skip to content

Commit

Permalink
Merge pull request #2 from observingClouds/ci
Browse files Browse the repository at this point in the history
continuous integration
  • Loading branch information
aaronspring authored Apr 4, 2022
2 parents 7996dc1 + 834ffcd commit eec6c5c
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 54 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ jobs:
run: conda info
- name: Conda list
run: conda list
- name: install bitinformation_pipeline
run: |
pip install .
- name: Run tests
run: pytest # -n 4 --durations=20
run: pytest
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Contributors
------------

* Hauke Schulz <[email protected]>
* Aaron Spring <[email protected]>
2 changes: 1 addition & 1 deletion bitinformation_pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__email__ = "[email protected]"
__version__ = "0.0.1"

from .bitinformation_pipeline import *
from .bitinformation_pipeline import get_bitinformation, get_keepbits
5 changes: 1 addition & 4 deletions bitinformation_pipeline/bitinformation_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
import xarray as xr
from julia.api import Julia

jl = Julia(compiled_modules=False)
jl = Julia(compiled_modules=False, debug=False)
from julia import Main # noqa: E402

path_to_julia_functions = os.path.join(
os.path.dirname(__file__), "get_n_plot_bitinformation.jl"
)
Main.path = path_to_julia_functions
jl.eval(
'import Pkg; Pkg.add(["BitInformation", "NetCDF", "PyPlot", "StatsBase", "ColorSchemes"])'
)
jl.using("BitInformation")
jl.eval("include(Main.path)")

Expand Down
21 changes: 0 additions & 21 deletions bitinformation_pipeline/cli.py

This file was deleted.

4 changes: 2 additions & 2 deletions bitinformation_pipeline/get_n_plot_bitinformation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using NetCDF, PyPlot, BitInformation, LaTeXStrings, JSON
using Statistics, StatsBase, ColorSchemes, Printf, PyPlot
using BitInformation
using StatsBase

function get_bitinformation(X::AbstractArray{T}, dim=1) where {T<:Base.IEEEFloat}

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dependencies:
- pip
- pip:
- git+https://github.com/observingClouds/numcodecs@bitround
- -e .
5 changes: 5 additions & 0 deletions install_julia_packages.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Pkg
Pkg.add("PyCall")
Pkg.add("BitInformation")
Pkg.add("StatsBase")
Pkg.status()
13 changes: 0 additions & 13 deletions requirements_dev.txt

This file was deleted.

44 changes: 32 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,60 @@

"""The setup script."""

import os

from setuptools import find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install

julia_install_command = "julia install_julia_packages.jl"


class PostDevelopCommand(develop):
"""Post-installation for development mode."""

def run(self):
develop.run(self)
os.system(julia_install_command)


class PostInstallCommand(install):
"""Post-installation for installation mode."""

def run(self):
install.run(self)
os.system(julia_install_command)


with open("README.md") as readme_file:
readme = readme_file.read()

with open("HISTORY.rst") as history_file:
history = history_file.read()

requirements = []
requirements = ["xarray", "julia"]

test_requirements = [
"pytest>=3",
]
test_requirements = ["pytest", "pooch", "netcdf4"]

setup(
author="Hauke Schulz",
author_email="[email protected]",
python_requires=">=3.6",
python_requires=">=3.8",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
description="Retrieve information content and compress accordingly.",
entry_points={
"console_scripts": [
"bitinformation_pipeline=bitinformation_pipeline.cli:main",
],
cmdclass={
"develop": PostDevelopCommand,
"install": PostInstallCommand,
},
description="Retrieve information content and compress accordingly.",
install_requires=requirements,
license="MIT license",
long_description=readme + "\n\n" + history,
Expand Down
1 change: 1 addition & 0 deletions tests/test_bitinformation_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ def test_get_bitinformation():
"""Test bm.get_bitinformation."""
ds = xr.tutorial.load_dataset("rasm")
bitinfo = bp.get_bitinformation(ds, dim=1)
print(bitinfo)
assert bitinfo

0 comments on commit eec6c5c

Please sign in to comment.