-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from config-i1/Python
Merging all Python developments so far to the main branch
- Loading branch information
Showing
46 changed files
with
12,780 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ man-roxygen | |
^revdep$ | ||
cran-comments.md | ||
^CRAN-SUBMISSION$ | ||
python | ||
src/python_examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: [Python] | ||
pull_request: | ||
branches: [Python] | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
src: "./python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "src/libs/carma"] | ||
path = src/libs/carma | ||
url = https://github.com/RUrlus/carma.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Version: 4.1.0 | ||
Date: 2024-10-01 13:06:02 UTC | ||
SHA: feb08010ab5a8340b3811ff3f1145ba32997cb43 | ||
Version: 4.1.1 | ||
Date: 2025-02-03 12:37:40 UTC | ||
SHA: 6b0700643ac3905c45e0ce2c29c80865b61098c8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Package: smooth | ||
Type: Package | ||
Title: Forecasting Using State Space Models | ||
Version: 4.1.1.41005 | ||
Date: 2025-01-05 | ||
Version: 4.1.1 | ||
Date: 2025-02-03 | ||
Authors@R: person("Ivan", "Svetunkov", email = "[email protected]", role = c("aut", "cre"), | ||
comment="Senior Lecturer at Centre for Marketing Analytics and Forecasting, Lancaster University, UK") | ||
URL: https://github.com/config-i1/smooth | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
project(smooth VERSION 0.0.1) | ||
|
||
if(SKBUILD) | ||
message(STATUS "The project is built using scikit-build") | ||
endif() | ||
|
||
# Pybind11 | ||
find_package(pybind11 REQUIRED) | ||
|
||
# CARMA | ||
ADD_SUBDIRECTORY(../src/libs/carma carma) | ||
|
||
# BLAS and LAPACK. Needed by Armadillo | ||
find_package(BLAS) | ||
find_package(LAPACK) | ||
if(LAPACK_FOUND AND BLAS_FOUND) | ||
set(lapackblas_libraries ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) | ||
else() | ||
# IS: This is where they are on my system. This might change from one OS to another | ||
set(lapackblas_libraries "/usr/lib/x86_64-linux-gnu/") | ||
endif() | ||
|
||
# Armadillo | ||
find_package(armadillo) | ||
IF(NOT ARMADILLO_FOUND) | ||
set(ARMADILLO_INCLUDE_DIRS "/usr/lib/") | ||
ENDIF() | ||
include_directories(${ARMADILLO_INCLUDE_DIRS}) | ||
|
||
# Adam General | ||
pybind11_add_module(_adam_general ../src/python_examples/adamGeneral.cpp) | ||
target_include_directories(_adam_general PRIVATE ../src/python_examples/.) | ||
target_link_libraries(_adam_general PRIVATE carma::carma ${ARMADILLO_LIBRARIES} ${lapackblas_libraries}) | ||
install(TARGETS _adam_general DESTINATION smooth/adam_general) | ||
|
||
|
||
# Old experimental stuff by Leo | ||
# code to add the pybind11 cpp module, look at demo project | ||
# (https://github.com/ltsaprounis/python-cpp-experiments/tree/main) for details. | ||
#pybind11_add_module(_my_linalg ../src/python_examples/my_linalg.cpp) | ||
|
||
# add CARMA as a subdirectory | ||
#add_subdirectory(../src/libs/carma build) | ||
#target_link_libraries(_my_linalg | ||
# PRIVATE carma::carma | ||
# ${ARMADILLO_LIBRARIES} | ||
#) | ||
|
||
# install(TARGETS _my_linalg DESTINATION smooth/my_linalg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.PHONY: all lint test install environment | ||
|
||
SRC_DIR = smooth | ||
|
||
lint: | ||
flake8 $(SRC_DIR) | ||
pydocstyle $(SRC_DIR) | ||
|
||
test: | ||
pytest $(SRC_DIR) | ||
|
||
install: | ||
pip install -e ".[dev]" | ||
|
||
environment: | ||
(\ | ||
echo "> Creating venv"; \ | ||
python -m venv .venv; \ | ||
source .venv/bin/activate; \ | ||
echo "> Installing local package in editable mode"; \ | ||
pip install -e ".[dev]"; \ | ||
echo "> Making venv available in jupyter notebooks"; \ | ||
python -m ipykernel install --name=$(SRC_DIR); \ | ||
jupyter kernelspec list; \ | ||
echo "> Installing pre-commit"; \ | ||
pre-commit install; \ | ||
) | ||
|
||
clean: | ||
echo "> Removing virtual environment" | ||
rm -r .venv | ||
echo "> Uninstalling from jupyter" | ||
jupyter kernelspec uninstall $(SRC_DIR) |
Oops, something went wrong.