Skip to content

Commit 27cc8aa

Browse files
authored
Merge pull request #11 from aaronweeden/rename-package
Rename package to `xdmod-data` and prepare for v1.0.0 release.
2 parents 7c5c713 + 33bdb9e commit 27cc8aa

27 files changed

+338
-793
lines changed

LICENSE

Lines changed: 159 additions & 668 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# xdmod-data
2+
As part of the [XDMoD](https://open.xdmod.org) Data Analytics Framework, this Python package provides API access to the data warehouse of an instance of XDMoD version ≥10.5.
3+
4+
The package can be installed from PyPI via `pip install xdmod-data`.
5+
6+
It has dependencies on [NumPy](https://pypi.org/project/numpy/), [Pandas](https://pypi.org/project/pandas/), [Plotly](https://pypi.org/project/plotly/), and [Requests](https://pypi.org/project/requests/).
7+
8+
Example usage is documented through Jupyter notebooks in the [xdmod-notebooks](https://github.com/ubccr/xdmod-notebooks) repository.
9+
10+
## API Token Access
11+
Use of the Data Analytics Framework requires an API token. To obtain an API token, follow the steps below to obtain an API token from the XDMoD portal.
12+
13+
1. First, if you are not already signed in to the portal, sign in in the top-left corner:
14+
15+
![Screenshot of "Sign In" button](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/sign-in.jpg)
16+
17+
1. Next, click the "My Profile" button in the top-right corner:
18+
19+
![Screenshot of "My Profile" button](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/my-profile.jpg)
20+
21+
1. The "My Profile" window will appear. Click the "API Token" tab:
22+
23+
![Screenshot of "API Token" tab](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/api-token-tab.jpg)
24+
25+
**Note:** If the "API Token" tab does not appear, it means this instance of XDMoD is not configured for the Data Analytics Framework.
26+
27+
1. If you already have an existing token, delete it:
28+
29+
![Screenshot of "Delete API Token" button](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/delete.jpg)
30+
31+
1. Click the "Generate API Token" button:
32+
33+
![Screenshot of "Generate API Token" button](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/generate.jpg)
34+
35+
1. Copy the token to your clipboard. Make sure to paste it somewhere for saving, as you will not be able to see the token again once you close the window:
36+
37+
![Screenshot of "Copy API Token to Clipboard" button](https://raw.githubusercontent.com/ubccr/xdmod-data/main/docs/images/api-token/copy.jpg)
38+
39+
**Note:** If you lose your token, simply delete it and generate a new one.
40+
41+
## Support
42+
For support, please see [this page](https://open.xdmod.org/support.html). If you email for support, please include the following:
43+
* `xdmod-data` version number, obtained by running this Python code:
44+
```
45+
from xdmod_data import __version__
46+
print(__version__)
47+
```
48+
* Operating system version.
49+
* A description of the problem you are experiencing.
50+
* Detailed steps to reproduce the problem.
51+
52+
## License
53+
`xdmod-data` is released under the GNU Lesser General Public License ("LGPL") Version 3.0. See the [LICENSE](LICENSE) file for details.
54+
55+
## Reference
56+
When referencing XDMoD, please cite the following publication:
57+
58+
> Jeffrey T. Palmer, Steven M. Gallo, Thomas R. Furlani, Matthew D. Jones, Robert L. DeLeon, Joseph P. White, Nikolay Simakov, Abani K. Patra, Jeanette Sperhac, Thomas Yearke, Ryan Rathsam, Martins Innus, Cynthia D. Cornelius, James C. Browne, William L. Barth, Richard T. Evans, "Open XDMoD: A Tool for the Comprehensive Management of High-Performance Computing Resources", *Computing in Science & Engineering*, Vol 17, Issue 4, 2015, pp. 52-62. DOI:10.1109/MCSE.2015.68

docs/conf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
from importlib.metadata import version
56
import os
67
import sys
78
sys.path.insert(0, os.path.abspath('..'))
@@ -12,22 +13,23 @@
1213
project = 'XDMoD Data Analytics Framework'
1314
copyright = '2023, University at Buffalo Center for Computational Research'
1415
author = 'University at Buffalo Center for Computational Research'
15-
release = '1.0'
16+
version = version('xdmod_data')
1617

1718
# -- General configuration ---------------------------------------------------
1819
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1920

2021
extensions = [
2122
'sphinx.ext.autodoc',
2223
'sphinx.ext.napoleon',
23-
'sphinx_rtd_theme',
2424
]
2525

26-
# templates_path = ['_templates']
27-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
28-
2926
# -- Options for HTML output -------------------------------------------------
3027
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3128

29+
html_show_sourcelink = False
3230
html_theme = 'sphinx_rtd_theme'
33-
# html_static_path = ['_static']
31+
32+
# -- Options for autodoc -----------------------------------------------------
33+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
34+
35+
autodoc_member_order = 'bysource'

docs/developing.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Developing a new version
2+
1. Make sure the version number is updated in `xdmod_data/__version__.py`.
3+
1. Create a Pull Request for the new version.
4+
5+
# Distributing the new version to PyPI
6+
After the Pull Request is approved, follow these steps in the `xdmod-data` root directory:
7+
1. Start up a virtual environment, e.g.:
8+
```
9+
$ env_dir=~/xdmod-data-build-env
10+
$ python3 -m venv ${env_dir}
11+
$ source ${env_dir}/bin/activate
12+
```
13+
1. Make sure the required packages are installed:
14+
```
15+
(env) $ python3 -m pip install --upgrade pip build setuptools twine
16+
```
17+
1. Build the built distribution:
18+
```
19+
(env) $ python3 -m build --wheel
20+
```
21+
1. Upload the built distribution to PyPI, e.g., for version 1.0.0-beta1:
22+
```
23+
(env) $ version=1.0.0b1
24+
(env) $ twine upload dist/xdmod_data-${version}-py3-none-any.whl
25+
```
26+
Enter your PyPI username and password.
22.7 KB
Loading

docs/images/api-token/copy.jpg

47.4 KB
Loading

docs/images/api-token/delete.jpg

31.8 KB
Loading

docs/images/api-token/generate.jpg

19 KB
Loading

docs/images/api-token/my-profile.jpg

20.4 KB
Loading

docs/images/api-token/sign-in.jpg

25.8 KB
Loading

docs/index.rst

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
.. XDMoD Data Analytics Framework documentation master file, created by
2-
sphinx-quickstart on Fri Feb 3 17:15:03 2023.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
1+
XDMoD Data Analytics Framework |version|
2+
========================================
53

6-
XDMoD Data Analytics Framework
7-
==============================
8-
9-
.. automodule:: xdmod.datawarehouse
10-
:members:
11-
12-
.. toctree::
13-
:maxdepth: 2
14-
:caption: Contents:
4+
This documents the `xdmod-data <https://github.com/ubccr/xdmod-data>`_ Python
5+
module.
156

7+
Example usage is documented through Jupyter notebooks in the
8+
`xdmod-notebooks <https://github.com/ubccr/xdmod-notebooks>`_ repository.
169

10+
.. automodule:: xdmod_data.warehouse
11+
:members:
1712

18-
Indices and tables
19-
==================
20-
21-
* :ref:`genindex`
22-
* :ref:`modindex`
23-
* :ref:`search`
13+
.. toctree::
14+
:maxdepth: 2
15+
:caption: Contents:

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
numpy
2+
pandas
3+
plotly
4+
requests

setup.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[metadata]
2+
name = xdmod-data
3+
version = attr: xdmod_data.__version__
4+
author = Aaron Weeden, Joseph P. White
5+
maintainer = Aaron Weeden, Joseph P. White
6+
description = Python package for XDMoD data access
7+
long_description = file: README.md
8+
long_description_content_type = text/markdown
9+
license_files = LICENSE
10+
project_urls =
11+
Source Code = https://github.com/ubccr/xdmod-data
12+
13+
[options]
14+
packages = find:
15+
python_requires = >=3
16+
install_requires =
17+
numpy
18+
pandas
19+
plotly
20+
requests

setup.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
from setuptools import setup, find_packages
2-
from xdmod.__version__ import __title__, __version__, __description__
1+
from setuptools import setup
32

4-
setup(
5-
name=__title__,
6-
version=__version__,
7-
description=__description__,
8-
license='LGPLv3',
9-
author='Joseph P White',
10-
author_email='jpwhite4@buffalo.edu',
11-
url='https://github.com/ubccr/xdmod-python',
12-
zip_safe=True,
13-
packages=find_packages(),
14-
install_requires=[
15-
'numpy',
16-
'pandas',
17-
'plotly',
18-
'requests',
19-
]
20-
)
3+
setup()

tests/integration/test_datawarehouse_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
import xdmod.datawarehouse as xdw
2+
from xdmod_data.warehouse import DataWarehouse
33
import pandas
44

55
VALID_XDMOD_URL = 'https://xdmod-dev.ccr.xdmod.org:9001'
@@ -101,13 +101,13 @@
101101

102102
@pytest.fixture(scope='module')
103103
def dw_methods():
104-
with xdw.DataWarehouse(VALID_XDMOD_URL) as dw:
104+
with DataWarehouse(VALID_XDMOD_URL) as dw:
105105
yield __get_dw_methods(dw)
106106

107107

108108
@pytest.fixture(scope='module')
109109
def dw_methods_outside_runtime_context():
110-
dw = xdw.DataWarehouse(VALID_XDMOD_URL)
110+
dw = DataWarehouse(VALID_XDMOD_URL)
111111
return __get_dw_methods(dw)
112112

113113

tests/regression/test_datawarehouse_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
import xdmod.datawarehouse as xdw
2+
from xdmod_data.warehouse import DataWarehouse
33
import pandas
44
import numpy
55
import os
@@ -10,7 +10,7 @@
1010

1111
@pytest.fixture(scope='module')
1212
def valid_dw():
13-
with xdw.DataWarehouse(XDMOD_URL) as dw:
13+
with DataWarehouse(XDMOD_URL) as dw:
1414
yield dw
1515

1616

tests/unit/test_datawarehouse_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
import os
33
import requests
4-
from xdmod.datawarehouse import DataWarehouse
4+
from xdmod_data.warehouse import DataWarehouse
55

66

77
VALID_XDMOD_URL = 'https://xdmod.access-ci.org'

xdmod/__version__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

xdmod_data/__version__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__title__ = 'xdmod-data'
2+
__version__ = '1.0.0'
File renamed without changes.

xdmod/_http_requester.py renamed to xdmod_data/_http_requester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import os
33
import requests
44
from urllib.parse import urlencode
5-
import xdmod._validator as _validator
6-
from xdmod.__version__ import __title__, __version__
5+
import xdmod_data._validator as _validator
6+
from xdmod_data.__version__ import __title__, __version__
77

88

99
class _HttpRequester:
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)