TNO Intern

Commit 93b7146f authored by Lewis Blake's avatar Lewis Blake 🇳🇴
Browse files

Introduce packaging

parent a4f25365
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -28,3 +28,8 @@ ENV/
env.bak/
venv.bak/
.vscode
.tmp

#packaging
build/
src/cso.egg-info/*
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.5.5
  hooks:
    - id: ruff-format
    - id: ruff # linter
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
@@ -37,6 +37,32 @@ Note that the documenation requires 'sphinx',
which is usually part of your python distribution.


Installation from source
------------------------

CSO can be installed from source in either conda or virtual environments.

**Pip**

The file py_project.toml contains the dependencies needed by CSO.  

    python3 -m venv --prompt cso .venv

This will create a new Python evironment folder called `cso`. To activate it run

    source .venv/bin/activate

You may need to updated pip with the command

    pip install -U pip

We can then install CSO and its dependencies simply using pip

    pip install -e .

The `-e` flag installs CSO in editable mode, meaning that the user can change the source code and run CSO anywhere using these changes.


Tutorial
--------

pyproject.toml

0 → 100644
+47 −0
Original line number Diff line number Diff line
[build-system]
requires = ["setuptools >= 40.9.0"]
build-backend = "setuptools.build_meta"

[project]
name = "cso"
version = "0.1.0"
authors = [{ name = "Arjo Segers" }]
description = "CAMS Satellite Operator (CSO) tool."
readme = "README.md"
classifiers = [
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "License :: MIT",
    "Operating System :: OS Independent",
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Science/Research",
    "Intended Audience :: Education",
    "Topic :: Scientific/Engineering :: Atmospheric Science",
]
requires-python = ">=3.10"

dependencies = [
    "cartopy>=0.20",
    "shapely",
    "numpy",
    "matplotlib",
    "numba",
    "pandas",
    "tqdm",
    "xarray",
    "netcdf4",
    "scipy >=1.1.0",
    "requests",
    "typer",
]

[project.urls]
Home = "https://ci.tno.nl/gitlab/cams/cso"

[project.optional-dependencies]
docs = ["pre-commit"]

[project.scripts]
cso = "cso.scripts.cli:main"

src/cso/__init__.py

0 → 100644
+20 −0
Original line number Diff line number Diff line
from importlib import metadata

__version__ = metadata.version(__package__)

from .cso_file import *
from .cso_catalogue import *
from .cso_inquire import *

# from .cso_scihub import *
from .cso_pal import *
from .cso_s5p import *
from .cso_superobs import *
from .cso_gridded import *
from .cso_colocate import *
from .cso_superobs import *
from .cso_regions import *
from .cso_constants import *
from .cso_mapping import *
from .cso_plot import *
from .cso_dataspace import *
 No newline at end of file
Loading