Commit b4ef6e12 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Remove nix for now.

parent b3bd57ea
# SPDX-FileCopyrightText: 2020 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences, Germany (https://www.gfz-potsdam.de/)
#
# SPDX-License-Identifier: CC0-1.0
{ pkgs ? import
(builtins.fetchTarball {
name = "nixpkgs-20.09";
url = "https://github.com/NixOS/nixpkgs/archive/edb26126d98bc696f4f3e206583faa65d3d6e818.tar.gz";
sha256 = "1cl4ka4kk7kh3bl78g06dhiidazf65q8miyzaxi9930d6gwyzkci";
})
rec {
unstable = import <unstable> {};
overlays = [
(self: super:
rec {
python37 = super.python37.override
{
packageOverrides = self: super: {
scipy = unstable.python37Packages.scipy;
matplotlib = super.matplotlib.overrideAttrs
(oldAttrs: rec {
version = "3.2.1";
src = super.fetchPypi
{
inherit version;
inherit (oldAttrs) pname;
sha256 = "ffe2f9cdcea1086fc414e82f42271ecf1976700b8edd16ca9d376189c6d93aee";
};
});
orthopoly = super.callPackage ./tests/nix/orthopoly.nix { };
pyfield = super.callPackage ./tests/nix/pyfield.nix { };
pymagglobal = super.callPackage ./pymagglobal.nix { };
};
};
python37Packages = python37.pkgs;
}
)
];
}
}:
pkgs.mkShell {
buildInputs = with pkgs.python37Packages;
[ ipython pyfield pymagglobal cartopy matplotlib numpy scipy ];
}
......@@ -54,12 +54,6 @@ $ pip install pymagglobal --extra-index-url https://public:5mz_iyigu-WE3HySBH1J@
Since [conda](https://docs.conda.io/) version 4.6, conda and pip get along well. So you can also run `pip install ...` from inside your conda environment.
Another way to use `pymagglobal` is via nix-shell. With [nix](https://nixos.org/download.html) installed, simply run
```console
$ nix-shell
```
from within the `pymagglobal` root directory. You may also use the nix-expression [pymagglobal.nix] to include `pymagglobal` in your own environments.
## Documentation
Check out the extended documention [here](https://sec23.git-pages.gfz-potsdam.de/korte/pymagglobal). From the command line, you can use `pymagglobal` to get various results from the models. For example,
```console
......@@ -129,11 +123,6 @@ from `<pymagglobal>`. Some tests require `FieldTools`, `packaging` and `orthopol
$ pip install pymagglobal[tests] --extra-index-url https://public:5mz_iyigu-WE3HySBH1J@git.gfz-potsdam.de/api/v4/projects/1055/packages/pypi/simple
```
We also provide the expression for a nix-shell with all dependencies installed. This will however not test your local installation, but your local repository. To perform the tests, run
```console
$ nix-shell .tests-shell.nix --run "python tests/run_tests.py"
```
[FieldTools]: http://doi.org/10.5880/fidgeo.2019.033
## Contact
......
# This file complements pymagglobal.
#
# It is licensed under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
{ python
, buildPythonPackage
, lib
, numpy
, scipy
, pandas
, matplotlib
, cartopy }:
buildPythonPackage rec {
pname = "pymagglobal";
version = "0.1.0";
format = "other";
src = ./.;
installPhase = ''
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
${python}/bin/${python.executable} setup.py install \
--install-lib=$out/lib/${python.libPrefix}/site-packages \
--prefix="$out"
'';
propagatedBuildInputs = [
numpy
scipy
pandas
matplotlib
cartopy
];
meta = with lib; {
description = "Python interface for global geomagnetic field models.";
license = licenses.lgpl3;
maintainers = [ maintainers.arthus ];
};
}
# This file complements pymagglobal.
#
# It is licensed under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
{ pkgs ? import
(builtins.fetchTarball {
name = "nixpkgs-20.09";
url = "https://github.com/NixOS/nixpkgs/archive/edb26126d98bc696f4f3e206583faa65d3d6e818.tar.gz";
sha256 = "1cl4ka4kk7kh3bl78g06dhiidazf65q8miyzaxi9930d6gwyzkci";
})
{
overlays = [
(self: super:
rec {
python37 = super.python37.override
{
packageOverrides = self: super: {
matplotlib = super.matplotlib.overrideAttrs
(oldAttrs: rec {
version = "3.2.1";
src = super.fetchPypi
{
inherit version;
inherit (oldAttrs) pname;
sha256 = "ffe2f9cdcea1086fc414e82f42271ecf1976700b8edd16ca9d376189c6d93aee";
};
});
pymagglobal = super.callPackage ./pymagglobal.nix { };
};
};
python37Packages = python37.pkgs;
}
)
];
}
}:
pkgs.mkShell {
buildInputs = with pkgs.python37Packages;
[ pymagglobal cartopy matplotlib numpy scipy ];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment