Skip to content

Commit

Permalink
Merge branch 'main' into andres-paper
Browse files Browse the repository at this point in the history
  • Loading branch information
kumiori authored Nov 16, 2024
2 parents acbd25f + de5dd81 commit a87f529
Show file tree
Hide file tree
Showing 683 changed files with 11,221 additions and 37,783 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
60 changes: 60 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test Conda Installation

# This triggers the workflow on any push to the repository
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
test:
name: Test Conda Installation and Setup
runs-on: ubuntu-latest

# Steps to run
steps:
# Checkout the repo content to the runner
- name: Checkout repository
uses: actions/checkout@v2

# Set up Miniconda
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, defaults
auto-update-conda: true
auto-activate-base: true

# Create the environment and install dependencies
- name: Create and activate conda environment
run: |
echo "Creating the conda environment: fenicsx-env"
conda create -n fenicsx-env -c conda-forge fenics-dolfinx=0.7.2 mpich pyvista sympy pandas pyyaml -y
echo "Activating the conda environment"
source $(conda info --base)/etc/profile.d/conda.sh # Fix to allow `conda activate`
conda activate fenicsx-env
echo "Environment created and activated. Now, verifying installation..."
conda list # Print all installed packages for verification
which python # Verify the Python interpreter being used
# Install the irrevolutions package in the conda environment
- name: Install irrevolutions
run: |
source $(conda info --base)/etc/profile.d/conda.sh # Ensure conda is properly initialized
echo "Installing irrevolutions package"
conda activate fenicsx-env
python -m pip install . # Assuming irrevolutions is in the current directory
echo "irrevolutions package installed"
# Optionally run tests within the environment
- name: Run tests
run: |
source $(conda info --base)/etc/profile.d/conda.sh # Ensure conda is properly initialized
echo "Running tests"
conda activate fenicsx-env
cd test && python3 -m pytest . || echo "Tests failed"
55 changes: 0 additions & 55 deletions .github/workflows/pull-image.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test Ubuntu Installation

# This triggers the workflow on any push to the repository
on:
workflow_dispatch:

# push:
# branches:
# - "**"
# pull_request:

jobs:
test:
name: Test Ubuntu/apt Installation and Setup
runs-on: ubuntu-latest

# Steps to run
steps:
# Checkout the repo content to the runner
- name: Checkout repository
uses: actions/checkout@v2

# Install Ubuntu dependencies via APT
- name: Install system dependencies via APT
run: |
echo "Installing required system dependencies via APT"
sudo apt-get update
sudo apt-get install -y software-properties-common python3-pip git libgl1-mesa-glx xvfb libglu1 libxcursor1 libxinerama1
# Add the FEniCS PPA and install fenicsx
- name: Install fenicsx
run: |
echo "Adding FEniCS PPA and installing fenicsx"
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt update
sudo apt-get install -y fenicsx
# Install irrevolutions dependencies (if any) and the package itself
- name: Install Python dependencies and irrevolutions
run: |
echo "Installing Python dependencies and irrevolutions"
python3 -m pip install --upgrade pip
python3 -m pip install numpy==1.21.6 --force-reinstall # Downgrade NumPy to a compatible version
python3 -m pip install . # Install irrevolutions package
- name: Check versions of installed packages
run: |
python3 -c "import numpy; print(f'NumPy version: {numpy.__version__}')"
python3 -c "import scipy; print(f'SciPy version: {scipy.__version__}')"
python3 -c "import pyvista; print(f'PyVista version: {pyvista.__version__}')"
# Optionally run tests within the environment
- name: Run tests
run: |
echo "Running tests"
cd test && python3 -m pytest . || echo "Tests failed"
32 changes: 32 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Tests in Docker Container
run-name: We are testing irrevolutions

on:
push:
branches:
- "**"

jobs:
set-up-computing-environment:
runs-on: ubuntu-latest
container: kumiori3/numerix:stable-amd64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: python3 -m pip install .

- name: List installed packages
run: |
pip list
- name: Test import
run: python3 -c "import irrevolutions"

- name: Run 1d test
run: pytest -v test/test_1d.py

- name: Run tests
run: cd test && pytest -v .
28 changes: 28 additions & 0 deletions .github/workflows/workflow_dolfinx_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Tests in Dolfinx Container
run-name: We are testing irrevolutions

on:
push:
branches:
- "**"

jobs:
set-up-computing-environment:
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/lab:v0.7.2

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: python3 -m pip install .

- name: Test import
run: python3 -c "import irrevolutions"

- name: Run 1d test
run: pytest -v test/test_1d.py

- name: Run tests
run: cd test && pytest -v .
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ test_*/
src/irrevolutions/test/output/*
**/output/**
**egg-info**
.venv/**
.venv/**
42 changes: 42 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Code of Conduct

## Our Pledge

In the interest of developing an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a smooth experience for everyone, regardless of age, size, personal quirks, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, religion, sex inclinations, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a friendly setting

## Our Responsibilities

Project maintainers are responsible for suggesting best practices of acceptable behavior and are in a position to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers may claim the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, public conferences and scientific gatherings, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Reporting

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team or in the [Issues page](https://github.com/kumiori/irrevolutions/issues). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team maintains confidentiality with regard to the details of an incident.

Project maintainers are bound to the Code of Conduct as well, failing to honour its best practices may lead to temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Contributing to Our Project
We welcome contributions from everyone in the community

### Reporting bugs

If you find a bug in Irrevolutions, please report it on the [GitHub issue
tracker](https://github.com/kumiori/irrevolutions/issues/new?labels=bug).


### Suggesting enhancements

If you want to suggest a new feature or an improvement of a current
feature, you can submit this on the [issue
tracker](https://github.com/kumiori/irrevolutions/issues).


### Submitting a pull request

To contribute code DOLFINx, create a pull request. If you want to
contribute, but are unsure where to start, have a look at the [Discussions page](https://github.com/kumiori/irrevolutions/discussions).
For substantial changes/contributions, please start with an issue or
start a new Discussion thread.

On opening a pull request, unit tests will run on GitHub CI. You can
click on these in the pull request to see where (if anywhere) the tests
are failing.


### Code of conduct

We suggest all our contributors to read the [code of
conduct](CODE-OF-CONDUCT.md).


1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include irrevolutions/models/default_parameters.yml
Loading

0 comments on commit a87f529

Please sign in to comment.