%global _empty_manifest_terminate_build 0
Name: python-spacegrids
Version: 1.9
Release: 1
Summary: numpy array with grids and associated operations
License: BSD
URL: https://github.com/willo12/spacegrids
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/27/2f/ae92422f65f2c76c9c9a5fcdaff39df466b7d223f241eb6ddfda50ca2238/spacegrids-1.9.tar.gz
BuildArch: noarch
%description
Spacegrids is an open source library providing a Numpy array with grids, labelled axes and associated grid-related mathematical methods such as regridding and integration. Spacegrids provides an object data model of Netcdf data that ensures consistency between a Numpy data array and its grid under common operations (and so avoiding common pitfalls related to axis interpretation), and much more. It is a write less do more library for everyday use.
These `interactive plots from Netcdf data `_ are based on Spacegrids.
The Field, Gr (grid) and Coord objects make everyday use easy:
>>> import spacegrids as sg
>>> D = sg.info(nonick = True)
>>> P = sgPproject(D['my_project'] , nonick = True)
>>> P.load(['temperature','u'])
>>> # obtain the axes objects under their names T,X,Y,Z:
>>> for c in P['some_experiment'].axes:
>>> exec c.name + ' = c' # now we can refer to X,Y
>>> TEMP = P['some_experiment']['temperature']
>>> U = P['some_experiment']['u'] # zonal velocity
>>> TEMP_sliced = TEMP[Y,:50] # slice. Note Y axis object
>>> m_TEMP = TEMP_sliced/(X*Y) # take hor. mean
>>> TEMP_regridded = TEMP.regrid(U.gr) # U grid differs
%package -n python3-spacegrids
Summary: numpy array with grids and associated operations
Provides: python-spacegrids
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-spacegrids
Spacegrids is an open source library providing a Numpy array with grids, labelled axes and associated grid-related mathematical methods such as regridding and integration. Spacegrids provides an object data model of Netcdf data that ensures consistency between a Numpy data array and its grid under common operations (and so avoiding common pitfalls related to axis interpretation), and much more. It is a write less do more library for everyday use.
These `interactive plots from Netcdf data `_ are based on Spacegrids.
The Field, Gr (grid) and Coord objects make everyday use easy:
>>> import spacegrids as sg
>>> D = sg.info(nonick = True)
>>> P = sgPproject(D['my_project'] , nonick = True)
>>> P.load(['temperature','u'])
>>> # obtain the axes objects under their names T,X,Y,Z:
>>> for c in P['some_experiment'].axes:
>>> exec c.name + ' = c' # now we can refer to X,Y
>>> TEMP = P['some_experiment']['temperature']
>>> U = P['some_experiment']['u'] # zonal velocity
>>> TEMP_sliced = TEMP[Y,:50] # slice. Note Y axis object
>>> m_TEMP = TEMP_sliced/(X*Y) # take hor. mean
>>> TEMP_regridded = TEMP.regrid(U.gr) # U grid differs
%package help
Summary: Development documents and examples for spacegrids
Provides: python3-spacegrids-doc
%description help
Spacegrids is an open source library providing a Numpy array with grids, labelled axes and associated grid-related mathematical methods such as regridding and integration. Spacegrids provides an object data model of Netcdf data that ensures consistency between a Numpy data array and its grid under common operations (and so avoiding common pitfalls related to axis interpretation), and much more. It is a write less do more library for everyday use.
These `interactive plots from Netcdf data `_ are based on Spacegrids.
The Field, Gr (grid) and Coord objects make everyday use easy:
>>> import spacegrids as sg
>>> D = sg.info(nonick = True)
>>> P = sgPproject(D['my_project'] , nonick = True)
>>> P.load(['temperature','u'])
>>> # obtain the axes objects under their names T,X,Y,Z:
>>> for c in P['some_experiment'].axes:
>>> exec c.name + ' = c' # now we can refer to X,Y
>>> TEMP = P['some_experiment']['temperature']
>>> U = P['some_experiment']['u'] # zonal velocity
>>> TEMP_sliced = TEMP[Y,:50] # slice. Note Y axis object
>>> m_TEMP = TEMP_sliced/(X*Y) # take hor. mean
>>> TEMP_regridded = TEMP.regrid(U.gr) # U grid differs
%prep
%autosetup -n spacegrids-1.9
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-spacegrids -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot - 1.9-1
- Package Spec generated