Skip to content

Commit

Permalink
Refactoring (#125)
Browse files Browse the repository at this point in the history
* core refactoring

* restructuring

* Update whats_new.rst (#124)

* Update ci-extensions.yaml

* Update whats_new.rst

* update domain table resource path

* using domain_id identifier

* update docs

* update ci environment

* clean up
  • Loading branch information
larsbuntemeyer authored Jul 17, 2023
1 parent 8ea80c8 commit ef512e8
Show file tree
Hide file tree
Showing 25 changed files with 285 additions and 279 deletions.
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

13 changes: 0 additions & 13 deletions AUTHORS.rst

This file was deleted.

125 changes: 0 additions & 125 deletions CONTRIBUTING.rst

This file was deleted.

8 changes: 0 additions & 8 deletions HISTORY.rst

This file was deleted.

11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

5 changes: 2 additions & 3 deletions ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ dependencies:
- cmor
- cdo
- python-cdo
- py-cordex>=0.4
# - pip:
# - git+https://github.com/euro-cordex/py-cordex.git # always use master for now
- pip:
- git+https://github.com/euro-cordex/py-cordex.git # always use master for now
14 changes: 13 additions & 1 deletion docs/authors.rst
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
.. include:: ../AUTHORS.rst
=======
Credits
=======

Development Lead
----------------

* `Lars Buntemeyer <https://github.com/larsbuntemeyer>`_

Contributors
------------

* `Ludwig Lierhammer <https://github.com/ludwiglierhammer>`_
126 changes: 125 additions & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -1 +1,125 @@
.. include:: ../CONTRIBUTING.rst
.. highlight:: shell

============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/remo-rcm/pyremo/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

The pyremo package could always use more documentation, whether as part of the
official Cordex Python Package docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/remo-rcm/pyremo/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `pyremo` for local development.

Forking
~~~~~~~

You will need create your own fork of the project. This is really easy using the github
interface, just go to the `pyremo project page <https://github.com/remo-rcm/pyremo>`_ and hit the ``Fork`` button.
From your fork, you then clone the repository to your machine::

git clone https://github.com/your-user-name/pyremo.git
cd pyremo
git remote add upstream https://github.com/remo-rcm/pyremo.git


Creating a Python Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the development environment, we recommend to use the conda package manager.

- Install either `Anaconda <https://www.anaconda.com/download/>`_ or `miniconda
<https://conda.io/miniconda.html>`_
- Make sure your conda is up to date (``conda update conda``)
- ``cd`` to the *pyremo* source directory

We don't recommend to use pip installation for development since some
depdencenies (like ``cartopy`` or ``xesmf``) require pre-compiled libraries
in the backend. So the safest way to go is:

1. Install the build dependencies
2. Build and install pyremo from source

.. code-block:: sh
# Create and activate the build environment
conda create -c conda-forge -n pyremo-tests python=3.9
conda env update -f ci/requirements/environment.yml
conda activate pyremo-tests
# Build and install pyremo in editable mode
pip install -e .
At this point you should be able to import *pyremo* from your locally
built version:

.. code-block:: sh
$ python # start an interpreter
>>> import pyremo
>>> pyremo.__version__
The nice thing about the *editable* mode (that's the ``-e`` flag in the pip install command) is
that you can edit the code directly in the package and use it without having to reinstall
the package. If you work a lot in Jupyter notebooks for development, you should check out
the autoreload magic, e.g., add a cell in the top of your notebook containing:

.. code-block:: sh
%load_ext autoreload
%autoreload 2
This will allow you to edit the *pyremo* source code and use it directly in the notebook
without having to restart the kernel.

See the full conda docs `here <http://conda.pydata.org/docs>`__.
1 change: 0 additions & 1 deletion docs/history.rst

This file was deleted.

3 changes: 2 additions & 1 deletion docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ What's New
import pyremo
v0.5.1 (Unreleased)
v0.6.0 (Unreleased)
-------------------

Internal Changes
~~~~~~~~~~~~~~~~

- Refactoring of core modules, now using `domain_id` keyword instead of `short_name` (:pull:`125`).
- Renamed ``master`` to ``main``.

v0.5.1 (24 May 2023)
Expand Down
11 changes: 5 additions & 6 deletions pyremo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import pkg_resources

from . import physics, tutorial
from .core import codes, data, remo_ds
from .core.cal import parse_absolute_time, parse_dates
from .core.conventions import output_pattern
from .core.domain import domain_info, magic_number, magic_numbers, remo_domain
from .core.remo_ds import open_remo_dataset, preprocess, update_meta_info
from . import codes, data, physics, remo_ds, tutorial
from .cal import parse_absolute_time, parse_dates
from .conventions import output_pattern
from .domain import domain_info, magic_number, magic_numbers, remo_domain
from .remo_ds import open_remo_dataset, preprocess, update_meta_info
from .tables import domains, vc

try:
Expand Down
File renamed without changes.
Loading

0 comments on commit ef512e8

Please sign in to comment.