Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into joss-submission
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloceano committed Aug 7, 2024
2 parents 2c46726 + 73ccc50 commit 58fef82
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 27 deletions.
136 changes: 136 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
version: 2.1

jobs:
build_test:
docker:
- image: cimg/python:3.12
steps:
- checkout

- run:
name: Build (build_test)
command: python3 setup.py sdist bdist_wheel

- run:
name: Check if wheel file exists (build_test)
command: ls -l dist/

- run:
name: Set wheel filename (build_test)
command: |
export WHL_FILENAME=$(ls dist/*.whl)
echo "WHEEL FILE: $WHL_FILENAME"
- run:
name: Install dependencies (build_test)
command: |
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: Install package (build_test)
command: |
. venv/bin/activate
export WHL_FILENAME=$(ls dist/*.whl)
pip install $WHL_FILENAME
- run:
name: Install pytest (build_test)
command: |
. venv/bin/activate
pip install pytest
- run:
name: Run Tests (build_test)
command: |
. venv/bin/activate
pytest
- store_test_results:
path: test-reports

test_pypi_publish:
docker:
- image: cimg/python:3.12
steps:
- checkout

- run:
name: Create whl (test_pypi_publish)
command: python3 setup.py sdist bdist_wheel

- run:
name: Check if wheel file exists (test_pypi_publish)
command: ls -l dist/

- run:
name: Install dependencies (test_pypi_publish)
command: |
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: Install twine (test_pypi_publish)
command: |
. venv/bin/activate
pip install twine
- run:
name: Publish on TestPyPI
command: |
. venv/bin/activate
twine upload -u ${TESTPYPI_USERNAME} -p ${TESTPYPI_PASSWORD} --repository testpypi dist/* --verbose
pypi_publish:
docker:
- image: cimg/python:3.12
steps:
- checkout

- run:
name: Create whl (pypi_publish)
command: python3 setup.py sdist bdist_wheel

- run:
name: Check if wheel file exists (pypi_publish)
command: ls -l dist/

- run:
name: Install dependencies (pypi_publish)
command: |
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: Install twine (pypi_publish)
command: |
. venv/bin/activate
pip install twine
- run:
name: Publish on PyPI
command: |
. venv/bin/activate
twine upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} dist/* --verbose
workflows:
build_test_publish:
jobs:
- build_test
- test_pypi_publish:
requires:
- build_test
filters:
branches:
only:
- develop
- pypi_publish:
requires:
- build_test
filters:
branches:
only:
- main
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
python-version: '3.12.4'

- name: Install dependencies
run: |
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file.

## [1.0.3] - 2024-07-27
### Bug Fixes
- Deploying documentation

## [1.0.2] - 2024-07-27
### Added
- Improved CI/CD pipeline by ensuring up-to-date gh-pages branch before deployment.
- Updated installation instructions to include pip installation from PyPI.

## [1.0.1] - 2024-07-27
### Added
- Added `CHANGELOG.md` file to document changes.
- Published project to PyPI.
- Integrated CircleCI for continuous integration and deployment.

## [1.0.0] - 2024-07-16
### Initial Release
- Initial release of LorenzCycleToolkit.
- Implemented core functionalities for calculating the Lorenz Energy Cycle (LEC) in specific atmospheric regions.
- Added support for both Eulerian and Semi-Lagrangian frameworks.
- Provided options for fixed and moving computational domains.
- Generated detailed results in CSV format for energy, conversion, and generation terms.
- Included automatic plot generation for spatial and temporal analysis.
- Utilized Xarray, Dask, Pandas, and MetPy for data handling and computations.
- Comprehensive documentation and usage examples.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,36 @@ The LorenzCycleToolkit is a tool for calculating the Lorenz Energy Cycle (LEC) i

For detailed documentation and usage instructions, visit the [LorenzCycleToolkit Documentation](https://daniloceano.github.io/LorenzCycleToolkit/).

## Installation
To install the required dependencies, use the provided `requirements.txt` file:
```sh
pip install -r requirements.txt
```

## Basic Usage
Run the toolkit with a sample NetCDF file:
```sh
python lorenzcycletoolkit.py samples/testdata_ERA5.nc -r -f
```

For more detailed usage instructions, including configuration options and examples, please refer to the documentation.

## Contributing
Contributions are welcome! Please see the [contributing guide](CONTRIBUTING.md) for more details.

### Continuous Integration and Deployment

This project uses GitHub Actions for Continuous Integration (CI) and Continuous Deployment (CD).
This project uses GitHub Actions and CircleCI for Continuous Integration (CI) and Continuous Deployment (CD).

- **CI Pipeline**: The CI pipeline is triggered on each push and pull request to the repository. It runs the following steps:
- **CI Pipeline with GitHub Actions**: The CI pipeline is triggered on each push and pull request to the repository. It runs the following steps:
- Sets up the Python environment.
- Installs dependencies.
- Formats code using autopep8.
- Sorts imports using isort.
- Lints code using flake8.
- Runs tests using pytest.

- **CI Pipeline with CircleCI**: CircleCI is used to build, test, and publish the package. The pipeline runs the following steps:
- Builds the package.
- Checks if the wheel file exists.
- Installs dependencies.
- Installs the package.
- Runs tests using pytest.
- Publishes the package to TestPyPI for the `develop` branch.
- Publishes the package to PyPI for the `main` branch.

- **CD Pipeline**: The CD pipeline deploys the documentation to GitHub Pages whenever changes are pushed to the `main` branch.

You can view the CI/CD configuration in the following files:
- [python-app.yml](.github/workflows/python-app.yml)
- [deploy-docs.yml](.github/workflows/deploy-docs.yml)
- [config.yml](.circleci/config.yml)

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Expand Down
31 changes: 22 additions & 9 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@ Installation
Prerequisites
-------------
- Python 3.12 or later
- Required Python packages listed in `requirements.txt`

Steps
-----
1. Clone the repository::

1. Install via pip::

pip install LorenzCycleToolkit

2. Alternatively, clone the repository::

git clone https://github.com/daniloceano/lorenz-cycle.git
cd lorenz-cycle

2. Create and activate a virtual environment:
3. Create a virtual environment and activate it::

python -m venv venv
source venv/bin/activate

4. Install the dependencies::

- Using `venv`::
pip install -r requirements.txt

For Conda users:

1. Clone the repository::

python -m venv venv
source venv/bin/activate
git clone https://github.com/daniloceano/lorenz-cycle.git
cd lorenz-cycle

- Or using `conda`::
2. Create a Conda environment and activate it::

conda create --name lorenz-cycle python=3.12
conda activate lorenz-cycle
conda create --name lorenzcycletoolkit python=3.12
conda activate lorenzcycletoolkit

3. Install the dependencies::

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read_requirements():

setup(
name='LorenzCycleToolkit',
version='1.0.0',
version='1.0.3',
packages=find_packages(),
include_package_data=True,
install_requires=read_requirements(),
Expand Down

0 comments on commit 58fef82

Please sign in to comment.