diff --git a/.binder/environment.yml b/.binder/environment.yml index c7e386866..2d70a5e3c 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -3,250 +3,36 @@ channels: - conda-forge - defaults dependencies: - - _libgcc_mutex=0.1=conda_forge - - _openmp_mutex=4.5=1_gnu - - alabaster=0.7.12=py_0 - - anyio=2.1.0=py39hf3d152e_0 - - argon2-cffi=20.1.0=py39h3811e60_2 - - async_generator=1.10=py_0 - - attrs=20.3.0=pyhd3deb0d_0 - - babel=2.9.0=pyhd3deb0d_0 - - backcall=0.2.0=pyh9f0ad1d_0 - - backports=1.0=py_2 - - backports.functools_lru_cache=1.6.1=py_0 - - binutils_impl_linux-64=2.35=h18a2f87_9 - - binutils_linux-64=2.35=h67ddf6f_30 - - bleach=3.3.0=pyh44b312d_0 - - breathe=4.26.1=pyh44b312d_0 - - brotlipy=0.7.0=py39h3811e60_1001 - - ca-certificates=2020.12.5=ha878542_0 - - certifi=2020.12.5=py39hf3d152e_1 - - cffi=1.14.4=py39he32792d_1 - - chardet=4.0.0=py39hf3d152e_1 - - clang_variant=1.0=cling_v0.8 - - clangdev=5.0.0=h43905f9_1012 - - click=7.1.2=pyh9f0ad1d_0 - - click-completion=0.5.2=py39hf3d152e_2 - - click-log=0.3.2=pyh9f0ad1d_0 - - cling=0.8=hf817b99_0 - - colorama=0.4.4=pyh9f0ad1d_0 - - cppzmq=4.7.1=h118ccdd_1 - - cryptography=3.4.4=py39h95dcef6_0 - - cycler=0.10.0=py_2 - - cython=0.29.21=py39he80948d_2 - - dbus=1.13.6=hfdff14a_1 - - decorator=4.4.2=py_0 - - defusedxml=0.6.0=py_0 - - docutils=0.16=py39hf3d152e_3 - - doxyrest=2.0.0=lua53hb996a4a_0 - - entrypoints=0.3=pyhd8ed1ab_1003 - - expat=2.2.10=h9c3ff4c_0 - - fontconfig=2.13.1=hba837de_1004 - - freetype=2.10.4=h0708190_1 - - gcc_impl_linux-64=9.3.0=h70c0ae5_18 - - gcc_linux-64=9.3.0=hf25ea35_30 - - gdbm=1.18=h0a1914f_2 - - gettext=0.19.8.1=h0b5b191_1005 - - gf2x=1.3.0=h75e9656_1 - - gitdb=4.0.5=pyhd8ed1ab_1 - - gitpython=3.1.13=pyhd8ed1ab_0 - - glib=2.66.7=h9c3ff4c_0 - - glib-tools=2.66.7=h9c3ff4c_0 - - gmp=6.2.1=h58526e2_0 - - gst-plugins-base=1.14.5=h0935bb2_2 - - gstreamer=1.18.3=h3560a44_0 - - gxx_impl_linux-64=9.3.0=hd87eabc_18 - - gxx_linux-64=9.3.0=h3fbe746_30 - - icu=68.1=h58526e2_0 - - idna=2.10=pyh9f0ad1d_0 - - imagesize=1.2.0=py_0 - - importlib-metadata=3.4.0=py39hf3d152e_0 - - importlib_metadata=3.4.0=hd8ed1ab_0 - - ipykernel=5.4.2=py39hef51801_0 - - ipython=7.20.0=py39hef51801_2 - - ipython_genutils=0.2.0=py_1 - - ipywidgets=7.6.3=pyhd3deb0d_0 - - jedi=0.18.0=py39hf3d152e_2 - - jinja2=2.11.3=pyh44b312d_0 - - jpeg=9d=h36c2ea0_0 - - json5=0.9.5=pyh9f0ad1d_0 - - jsonschema=3.2.0=py_2 - - jupyter=1.0.0=py39hf3d152e_6 - - jupyter-cache=0.4.1=py_0 - - jupyter-sphinx=0.3.1=py_0 - - jupyter_client=6.1.11=pyhd8ed1ab_1 - - jupyter_console=6.2.0=py_0 - - jupyter_contrib_core=0.3.3=py_2 - - jupyter_core=4.7.1=py39hf3d152e_0 - - jupyter_nbextensions_configurator=0.4.1=py39hf3d152e_2 - - jupyter_server=1.3.0=py39hf3d152e_0 - - jupyterlab=3.0.7=pyhd8ed1ab_0 - - jupyterlab-git=0.22.0=py_0 - - jupyterlab_server=2.2.0=pyhd8ed1ab_0 - - jupyterlab_widgets=1.0.0=pyhd8ed1ab_1 - - jupytext=1.10.0=pyh44b312d_0 - - kernel-headers_linux-64=2.6.32=h77966d4_13 - - kiwisolver=1.3.1=py39h1a9c180_1 - - krb5=1.17.2=h926e7f8_0 - - latexcodec=2.0.1=pyh9f0ad1d_0 - - lcms2=2.12=hddcbb42_0 - - ld_impl_linux-64=2.35=h769bd43_9 - - libblas=3.9.0=8_openblas - - libcblas=3.9.0=8_openblas - - libclang=11.0.1=default_ha53f305_1 - - libedit=3.1.20191231=he28a2e2_2 - - libevent=2.1.10=hcdb4288_3 - - libffi=3.3=h58526e2_2 - - libflint=2.6.3=h6b702e8_0 - - libgcc-devel_linux-64=9.3.0=h7864c58_18 - - libgcc-ng=9.3.0=h2828fa1_18 - - libgfortran-ng=9.3.0=hff62375_18 - - libgfortran5=9.3.0=hff62375_18 - - libglib=2.66.7=h1f3bc88_0 - - libgomp=9.3.0=h2828fa1_18 - - libiconv=1.16=h516909a_0 - - liblapack=3.9.0=8_openblas - - libllvm11=11.0.1=hf817b99_0 - - libopenblas=0.3.12=pthreads_h4812303_1 - - libpng=1.6.37=h21135ba_2 - - libpq=12.3=h255efa7_3 - - libsodium=1.0.18=h36c2ea0_1 - - libstdcxx-devel_linux-64=9.3.0=hb016644_18 - - libstdcxx-ng=9.3.0=h6de172a_18 - - libtiff=4.2.0=hdc55705_0 - - libuuid=2.32.1=h7f98852_1000 - - libuv=1.40.0=h7f98852_0 - - libwebp-base=1.2.0=h7f98852_0 - - libxcb=1.13=h7f98852_1003 - - libxkbcommon=1.0.3=he3ba5ed_0 - - libxml2=2.9.10=h72842e0_3 - - livereload=2.6.3=pyh9f0ad1d_0 - - lua=5.4.0=h87292a4_0 - - lz4-c=1.9.3=h9c3ff4c_0 - - markdown-it-py=0.6.2=pyhd8ed1ab_0 - - markupsafe=1.1.1=py39h3811e60_3 - - matplotlib=3.3.4=py39hf3d152e_0 - - matplotlib-base=3.3.4=py39h2fa2bec_0 - - mdit-py-plugins=0.2.5=pyhd8ed1ab_0 - - mistune=0.8.4=py39h3811e60_1003 - - mpc=1.1.0=h04dde30_1009 - - mpfr=4.0.2=he80fd80_1 - - mysql-common=8.0.22=ha770c72_3 - - mysql-libs=8.0.22=h935591d_3 - - myst-nb=0.11.1=pyhd8ed1ab_0 - - myst-parser=0.13.3=pyhd8ed1ab_0 - - nbclassic=0.2.6=pyhd8ed1ab_0 - - nbclient=0.5.2=pyhd8ed1ab_0 - - nbconvert=5.6.0=py_0 - - nbdime=2.1.0=py_0 - - nbformat=5.0.8=py_0 - - nbstripout=0.3.9=pyh9f0ad1d_0 - - ncurses=6.2=h58526e2_4 - - nest-asyncio=1.4.3=pyhd8ed1ab_0 - - nlohmann_json=3.9.1=he1b5a44_0 - - nodejs=15.3.0=h92b4a50_1 - - notebook=6.2.0=py39hf3d152e_0 - - nspr=4.29=h9c3ff4c_1 - - nss=3.61=hb5efdd6_0 - - ntl=11.4.3=h1269aa5_1 - - numpy=1.20.1=py39hdbf815f_0 - - olefile=0.46=pyh9f0ad1d_1 - - openssl=1.1.1i=h7f98852_0 - - oset=0.1.3=py_1 - - packaging=20.9=pyh44b312d_0 - - pandas=1.2.2=py39hde0f152_0 - - pandoc=2.11.4=h7f98852_0 - - pandocfilters=1.4.2=py_1 - - parso=0.8.1=pyhd8ed1ab_0 - - pcre=8.44=he1b5a44_0 - - pexpect=4.8.0=pyh9f0ad1d_2 - - pickleshare=0.7.5=py_1003 - - pillow=8.1.0=py39hf95b381_2 - - pip=21.0.1=pyhd8ed1ab_0 - - prometheus_client=0.9.0=pyhd3deb0d_0 - - prompt-toolkit=3.0.16=pyha770c72_0 - - prompt_toolkit=3.0.16=hd8ed1ab_0 - - pthread-stubs=0.4=h36c2ea0_1001 - - ptyprocess=0.7.0=pyhd3deb0d_0 - - pugixml=1.11.4=h9c3ff4c_0 - - pybtex=0.24.0=py39hf3d152e_0 - - pybtex-docutils=1.0.0=py39hf3d152e_0 - - pycparser=2.20=pyh9f0ad1d_2 - - pygments=2.7.4=pyhd8ed1ab_0 - - pyopenssl=20.0.1=pyhd8ed1ab_0 - - pyparsing=2.4.7=pyh9f0ad1d_0 - - pyqt=5.12.3=py39hf3d152e_7 - - pyqt-impl=5.12.3=py39h0fcd23e_7 - - pyqt5-sip=4.19.18=py39he80948d_7 - - pyqtchart=5.12=py39h0fcd23e_7 - - pyqtwebengine=5.12.1=py39h0fcd23e_7 - - pyrsistent=0.17.3=py39h3811e60_2 - - pysocks=1.7.1=py39hf3d152e_3 - - python=3.9.1=hffdb5ce_5_cpython - - python-dateutil=2.8.1=py_0 - - python-symengine=0.6.1=py39h68068d8_3 - - python_abi=3.9=1_cp39 - - pytz=2021.1=pyhd8ed1ab_0 - - pyyaml=5.4.1=py39h3811e60_0 - - pyzmq=22.0.1=py39hea8fd45_0 - - qt=5.12.9=h9d6b050_2 - - qtconsole=5.0.2=pyhd8ed1ab_0 - - qtpy=1.9.0=py_0 - - rb-bundler=2.1.4=hd4c1694_0 - - readline=8.0=he28a2e2_2 - - requests=2.25.1=pyhd3deb0d_0 - - ruby=2.5.7=he592edb_2 - - send2trash=1.5.0=py_0 - - setuptools=49.6.0=py39hf3d152e_3 - - shellingham=1.4.0=pyh44b312d_0 - - six=1.15.0=pyh9f0ad1d_0 - - smmap=3.0.5=pyh44b312d_0 - - sniffio=1.2.0=py39hf3d152e_1 - - snowballstemmer=2.1.0=pyhd8ed1ab_0 - - sphinx=3.4.3=pyhd8ed1ab_0 - - sphinx-autobuild=2020.9.1=pyhd8ed1ab_0 - - sphinx-copybutton=0.3.1=pyhd8ed1ab_0 - - sphinx-sitemap=2.2.0=pyhd8ed1ab_0 - - sphinx-thebe=0.0.7=pyh9f0ad1d_0 - - sphinx-togglebutton=0.2.2=pyh9f0ad1d_0 - - sphinxcontrib-applehelp=1.0.2=py_0 - - sphinxcontrib-bibtex=1.0.0=py_0 - - sphinxcontrib-devhelp=1.0.2=py_0 - - sphinxcontrib-htmlhelp=1.0.3=py_0 - - sphinxcontrib-jsmath=1.0.1=py_0 - - sphinxcontrib-qthelp=1.0.3=py_0 - - sphinxcontrib-serializinghtml=1.1.4=py_0 - - sqlalchemy=1.3.23=py39h3811e60_0 - - sqlite=3.34.0=h74cdb3f_0 - - symengine=0.6.0=h800644d_1 - - sysroot_linux-64=2.12=h77966d4_13 - - terminado=0.9.2=py39hf3d152e_0 - - testpath=0.4.4=py_0 - - tk=8.6.10=h21135ba_1 - - toml=0.10.2=pyhd8ed1ab_0 - - tornado=6.1=py39h3811e60_1 - - traitlets=5.0.5=py_0 - - tzdata=2021a=he74cb21_0 - - urllib3=1.26.3=pyhd8ed1ab_0 - - wcwidth=0.2.5=pyh9f0ad1d_2 - - webencodings=0.5.1=py_1 - - wheel=0.36.2=pyhd3deb0d_0 - - widgetsnbextension=3.5.1=py39hf3d152e_4 - - xeus=1.0.0=h78d96c3_0 - - xeus-cling=0.12.0=h5a79028_0 - - xorg-libxau=1.0.9=h7f98852_0 - - xorg-libxdmcp=1.1.3=h7f98852_0 - - xtensor=0.23.1=h4bd325d_0 - - xtl=0.7.2=h4bd325d_0 - - xz=5.2.5=h516909a_1 - - yaml=0.2.5=h516909a_0 - - zeromq=4.3.4=h9c3ff4c_0 - - zipp=3.4.0=py_0 - - zlib=1.2.11=h516909a_1010 - - zstd=1.4.8=ha95c52a_1 + - xeus-cling + - llvmdev=5 + - gmp + - mpfr + - mpc + - cmake + - arb + - libflint + - ipykernel + - ipywidgets + - jupyter + - jupyter_nbextensions_configurator + - jupyterlab + - jupytext + - matplotlib + - myst-nb + - numpy + - pip + - python=3.9.1 + - ruby=2.5.7 + - sphinx=3.4.3 + - sphinx-autobuild + - sphinx-copybutton + - sphinx-sitemap + - sphinx-thebe + - sphinx-togglebutton + - sphinxcontrib-bibtex + - xeus-cling=0.12.0 + - xtensor - pip: - - beautifulsoup4==4.9.3 - - soupsieve==2.2 - - sphinx-dust==1.2.4 - - sphinx-proof==0.0.3 - - sphinx-library==1.1.2 + - sphinx-dust + - sphinx-proof + - sphinx-library diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index b97b7a0e3..4bbf34ae5 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,12 +1,6 @@ name: Build Documentation -on: - push: - branches: [ sources ] - pull_request: - branches: [ sources ] - schedule: - - cron: "0 0 * * */6" +on: [push, pull_request] jobs: build_docs: @@ -19,6 +13,8 @@ jobs: with: submodules: "recursive" # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + - name: Get CPP Notebooks + run: scripts/genMyst.sh - name: Cache conda uses: actions/cache@v1 env: @@ -42,7 +38,19 @@ jobs: environment-file: symedocs.yml python-version: 3.9 auto-activate-base: false - - name: Build + - name: Build SymEngine CPP core + run: | + git clone https://github.com/symengine/symengine symengine-cpp + cd symengine-cpp + mkdir build + cd build + export LDFLAGS="-Wl,-rpath,${NB_PYTHON_PREFIX}/lib -L${NB_PYTHON_PREFIX}/lib" + cmake -DWITH_COTIRE=no -DBUILD_SHARED_LIBS=yes -DWITH_MPC=yes -DWITH_ARB=yes -DINTEGER_CLASS=flint -DWITH_LLVM=yes -DCMAKE_PREFIX_PATH=${NB_PYTHON_PREFIX} -DCMAKE_INSTALL_PREFIX=${NB_PYTHON_PREFIX} -DBUILD_TESTS=off -DBUILD_BENCHMARKS=off -DCMAKE_INSTALL_LIBDIR=lib .. + make -j4 + sudo make install + cd .. + rm -rf build + - name: Build Docs run: sphinx-build docs ./public - name: Deploy Docs if: ${{ github.ref == 'refs/heads/sources' && github.repository == 'Symengine/symengine.github.io' }} diff --git a/.gitignore b/.gitignore index 77bd627bf..794f375e1 100644 --- a/.gitignore +++ b/.gitignore @@ -499,3 +499,6 @@ jupyter_execute/ .jupyter_cache/ *.ipynb notebooks/ + +# From other repositories +docs/use/api/cpp/ diff --git a/docs/use/api/cpp/Matrices.myst.md b/docs/use/api/cpp/Matrices.myst.md deleted file mode 100644 index eb8265e9b..000000000 --- a/docs/use/api/cpp/Matrices.myst.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -jupytext: - formats: ipynb,md:myst - text_representation: - extension: .md - format_name: myst - format_version: 0.13 - jupytext_version: 1.10.0 -kernelspec: - display_name: C++11 - language: C++11 - name: xcpp11 ---- - -# Matrices - -```{code-cell} -#include -#include - -#include -#include -#include -#include -#include -``` - -```{code-cell} -SymEngine::vec_basic elems{SymEngine::integer(1), - SymEngine::integer(0), - SymEngine::integer(-1), - SymEngine::integer(-2)}; -SymEngine::DenseMatrix A = SymEngine::DenseMatrix(2, 2, elems); -``` - -```{code-cell} -A.__str__() -``` diff --git a/docs/use/api/cpp/firststeps.myst.md b/docs/use/api/cpp/firststeps.myst.md deleted file mode 100644 index c2c858db5..000000000 --- a/docs/use/api/cpp/firststeps.myst.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -jupytext: - formats: ipynb,md:myst - text_representation: - extension: .md - format_name: myst - format_version: 0.13 - jupytext_version: 1.10.0 -kernelspec: - display_name: C++17 - language: C++17 - name: xcpp17 ---- - -# First Steps [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/symengine/symengine.github.io/sources?filepath=docs%2Fuse%2Fapi%2Fcpp%2Ffirststeps.myst.md) - -This is meant to be a gentle introduction to the `symengine` C++ library. - -## Working with Expressions - -We will start by inspecting the use of {ref}`Expression `. - -```{code-cell} -#include -using SymEngine::Expression; -``` - -```{code-cell} -Expression x("x"); -``` - -```{code-cell} -auto ex = pow(x+sqrt(Expression(2)), 6); -ex -``` - -```{code-cell} -expand(ex) -``` - -```{reviewer-meta} -:written-on: "2020-08-27" -:proofread-on: "2021-01-20" -:dust-days-limit: 60 -``` diff --git a/docs/use/api/cpp/index.md b/docs/use/api/cpp/index.md deleted file mode 100644 index c21e44e41..000000000 --- a/docs/use/api/cpp/index.md +++ /dev/null @@ -1,7 +0,0 @@ -# C++ Usage -This part of the documentation deals with the use of basic C++ structures. - -```{toctree} -:maxdepth: 2 -Expressions -``` diff --git a/scripts/genMyst.sh b/scripts/genMyst.sh new file mode 100755 index 000000000..46c0a544c --- /dev/null +++ b/scripts/genMyst.sh @@ -0,0 +1,30 @@ +#!/bin/bash +##################################################### +# Grab the notebooks in .myst.md form +# +# Author: Rohit Goswami +# Licence: MIT +##################################################### + +groot=$(git rev-parse --show-toplevel) + +# CPP +cppdir="$groot/docs/use/api/cpp" +if [ -d "$cppdir" ]; then + echo "Folder exists!!! Y to overwrite" + read delfol + if [ $delfol == "Y" ]; then + rm -rf $cppdir + else + echo "Exiting" + exit 1 + fi +fi +echo "Getting files" +"$groot/scripts/gitfolder.sh" "https://github.com/symengine/symengine/tree/master/docs/mystMD" +echo "Moving to the API directory" +mv mystMD $cppdir +rm -rf $cppdir/readme.org +echo "Done CPP" + +echo "Remember to commit changes to symengine/symengine!!!" diff --git a/scripts/gitfolder.sh b/scripts/gitfolder.sh new file mode 100755 index 000000000..492079b01 --- /dev/null +++ b/scripts/gitfolder.sh @@ -0,0 +1,26 @@ +#!/bin/bash +##################################################### +# Download Specific folders from Github using SVN +# +# Author: Declan Cook +# Licence: MIT +##################################################### +GHDOMAIN="https://github.com/" +IN=$1 +IN=${IN##$GHDOMAIN} +BRANCH="trunk" +FOLDER="" +IFS="/" read -a SECT <<< "$IN" + +if [[ "${SECT[3]}" != "master" ]]; then + BRANCH=${SECT[3]} +fi +for index in "${!SECT[@]}"; do + if [ $index -gt 3 ]; then + FOLDER=$FOLDER/${SECT[index]} + fi +done + +# DOMAIN/USER/PROJECT//FOLDER +echo Exporting $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER +svn export $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER diff --git a/symedocs.yml b/symedocs.yml index 53450bda6..2d70a5e3c 100644 --- a/symedocs.yml +++ b/symedocs.yml @@ -3,7 +3,14 @@ channels: - conda-forge - defaults dependencies: - - doxyrest + - xeus-cling + - llvmdev=5 + - gmp + - mpfr + - mpc + - cmake + - arb + - libflint - ipykernel - ipywidgets - jupyter @@ -15,7 +22,6 @@ dependencies: - numpy - pip - python=3.9.1 - - python-symengine=0.6.1 - ruby=2.5.7 - sphinx=3.4.3 - sphinx-autobuild @@ -24,12 +30,9 @@ dependencies: - sphinx-thebe - sphinx-togglebutton - sphinxcontrib-bibtex - - symengine=0.6.0 - xeus-cling=0.12.0 - xtensor - pip: - - beautifulsoup4 - - soupsieve - sphinx-dust - sphinx-proof - sphinx-library