Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement heterojunction in depletion approximation and fix build issues #256

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: install-rtools needed for windows
if: ${{ runner.os == 'Windows' }}
run: |
choco install rtools --no-progress
choco install rtools --version=4.0.0.20220206 --no-progress --force
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH

- name: Install cibuildwheel
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/test_unit_and_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: install-rtools
if: matrix.os == 'windows-latest'
run: |
choco install rtools --no-progress
choco install rtools --version=4.0.0.20220206 --no-progress --force
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH

- name: Install system dependencies in Linux
Expand All @@ -59,6 +59,7 @@ jobs:
- name: Install S4
if: matrix.os != 'windows-latest'
run: |
pip install wheel
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext
Expand All @@ -69,11 +70,18 @@ jobs:
run: |
python -m devpy build -- -Dwith_pdd=true -Dinstall_test=true

- name: Unit and functional tests
- name: Unit and functional tests (MacOS and Linux)
if: matrix.os != 'windows-latest'
env:
SOLCORE_SPICE: ngspice
run: |
python -m devpy test -- -r a -v --cov=solcore/ --ignore solcore/tests/test_examples.py -n "auto"
python -m devpy test -- -r a -v --cov=solcore/ --ignore=solcore/tests/test_examples.py -n "auto"

- name: Unit and functional tests (Windows)
if: matrix.os == 'windows-latest'
run: |
cd D:\a\solcore5\solcore5\build-install\usr\Lib\site-packages
python -m pytest -r a -v --ignore=solcore/tests/test_examples.py

- name: Codecov
env:
Expand Down Expand Up @@ -104,7 +112,7 @@ jobs:
- name: install-rtools
if: matrix.os == 'windows-latest'
run: |
choco install rtools --no-progress
choco install rtools --version=4.0.0.20220206 --no-progress --force
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH

- name: Install system dependencies in Linux
Expand All @@ -131,6 +139,7 @@ jobs:
- name: Install S4
if: matrix.os != 'windows-latest'
run: |
pip install wheel
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext
Expand All @@ -148,7 +157,7 @@ jobs:
run: |
python -m devpy test -- -r a -v solcore/tests/test_examples.py -n "auto"

- name: Unit and functional tests (Windows)
if: matrix.os == 'windows-latest'
run: |
python -m devpy test -- -r a -v solcore/tests/test_examples.py -n "auto"
# - name: Unit and functional tests (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# python -m devpy test -- -r a -v solcore/tests/test_examples.py
19 changes: 16 additions & 3 deletions docs/source/Installation/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ following command in your terminal::

pip install solcore

This will download Solcore form the PyPI repository and install the package within the active Python environment. Depending
This will download Solcore from the PyPI repository and install the package within the
active Python environment. Depending
on your operating system/Python installation you may need to use `pip3` instead of `pip`. And that's all! Solcore should
be available to be used as with any Python package::

>>> import solcore

Note that the above should install the Fortran-based Poisson drift-diffusion (PDD)
solver, without requiring local compilation (i.e. you do not need to have Fortran
compiler installed on your computer -- see further details below). If you would like to
install Solcore without
the PDD solver, you can do so by running::

pip install solcore --config-setting=setup-args="-Dwith_pdd=false"

Installation details
^^^^^^^^^^^^^^^^^^^^

Expand All @@ -51,7 +60,10 @@ run from the directory where *pyproject.toml* is located::
pip install .

This will compile the PDD solver locally, so you will need to have a
:doc:`a suitable Fortran compiler (only needed for the PDD solver) <compilation>`.
:doc:`a suitable Fortran compiler (only needed for the PDD solver) <compilation>`. If
you wish to install Solcore from source without compiling the PDD solver, you can do so by running::

pip install . --config-setting=setup-args="-Dwith_pdd=false"


Installing in development mode
Expand All @@ -61,7 +73,8 @@ If you are planning to develop Solcore further, you may want to have all the fil
the default installation location for pip), while still being able to use the package from other places and examples, so
that if you make changes to the solcore5 folder those changes will be reflected in installed versions of the package.
To achieve this, you need to install Solcore in editable/development mode. Download or clone the source from the
`Solcore GitHub repository <https://github.com/dalonsoa/solcore5>`_ as above, make sure the dependencies are installed
`Solcore GitHub repository <https://github.com/dalonsoa/solcore5>`_ as above, and make
sure the dependencies are installed
(the easiest way to do this is to run `pip install solcore`, which will install Solcore with dependencies as usual,
followed by `pip uninstall solcore`). In the folder where *pyproject.toml* is located run::

Expand Down
38 changes: 0 additions & 38 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
project('solcore',
'c',
version: '5.9.1',
license: 'GNU LGPL',
meson_version: '>= 0.64.0',
Expand All @@ -11,48 +10,11 @@ project('solcore',
]
)

cc = meson.get_compiler('c')
# TODO: the below -Wno flags are all needed to silence warnings in
# f2py-generated code. This should be fixed in f2py itself.
_global_c_args = cc.get_supported_arguments(
'-Wno-unused-but-set-variable',
'-Wno-unused-function',
'-Wno-unused-variable',
'-Wno-surprising',
'-Wno-conversion',
'-Wno-misleading-indentation',
'-Wno-incompatible-pointer-types',
)
add_project_arguments(_global_c_args, language : 'c')

add_languages('cython')
add_languages('fortran', native: false)

cross = meson.is_cross_build()
message('CROSS:', cross)

ff = meson.get_compiler('fortran')
_global_ff_args = ff.get_supported_arguments(
'-Wno-unused-variable',
'-Wno-surprising',
'-Wno-conversion',
'-Wno-maybe-uninitialized',
'-Wno-unused-dummy-argument'
)
add_project_arguments(_global_ff_args, language: 'fortran')

is_windows = host_machine.system() == 'windows'
message('WINDOWS:', is_windows)

if is_windows and meson.get_compiler('fortran').get_id() == 'gcc'
# For mingw-w64, link statically against the UCRT.
gcc_link_args = ['-lucrt', '-static']
add_project_link_arguments(gcc_link_args, language: ['fortran'])
endif

py_mod = import('python')
py = py_mod.find_installation('python3', pure: false)
py_dep = py.dependency()
message('py DIR', py.full_path())
message('install DIR', py.get_install_dir())

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers=[
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"numpy",
"numpy>=1.21.0",
"matplotlib",
"scipy",
"tmm",
Expand Down