Skip to content

Commit

Permalink
removed idea editor files and added gitignore
Browse files Browse the repository at this point in the history
updated CI python versions, increased version number to 1.1

fixed matplotlib private method removed, removed outdated README in tests folder

pre-commit run --all-files

removed np.array on ckeys

addressed ci message:

    Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v1. Please update your workflow to use either v3 or v4
  • Loading branch information
rikigigi committed Dec 28, 2024
1 parent d870ce8 commit 93fcc47
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 85 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Install python dependencies
run:
Expand All @@ -39,23 +39,23 @@ jobs:

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- run: python .github/workflows/check_release_tag.py $GITHUB_REF setup.json

pre-commit:
Expand All @@ -41,10 +41,10 @@ jobs:
restore-keys:
pip-pre-commit-

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Install python dependencies
run:
Expand All @@ -60,7 +60,7 @@ jobs:

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- name: Build package
run: |
pip install wheel
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ coverage.xml
# Visual Studio Code
.vscode/

# idea editor
.idea

# Translations
*.mo
*.pot
Expand Down
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/sportran.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

8 changes: 4 additions & 4 deletions setup.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "sportran",
"version": "1.0.0rc4",
"version": "1.1.0",
"author": "Loris Ercole, Riccardo Bertossa, Sebastiano Bisacchi",
"author_email": "[email protected]",
"description": "Cepstral Data Analysis of current time series for Green-Kubo transport coefficients",
"license": "GPL 3",
"url": "https://github.com/sissaschool/sportran",
"keywords": "cepstral data analysis thermal conductivity transport coefficients physics green-kubo",
"python_requires": ">=3.7, <4",
"python_requires": ">=3.9, <4",
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
Expand Down
2 changes: 1 addition & 1 deletion sportran/i_o/read_lammps_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _read_ckeys(self, group_vectors=True, preload_timesteps=True):
line = self.file.readline()
if len(line) == 0: # EOF
raise RuntimeError('Reached EOF, no ckeys found.')
values = np.array(line.split())
values = line.split()
if (values[0] == 'ITEM:'):
if (values[1] == 'TIMESTEP'):
self.current_timestep = int(self.file.readline())
Expand Down
2 changes: 1 addition & 1 deletion sportran/i_o/read_lammps_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _read_ckeys(self, run_keyword, group_vectors=True):
nlines += 1
if len(line) == 0: # EOF
raise RuntimeError('Reached EOF, no ckeys found.')
values = np.array(line.split())
values = line.split()
# find the column headers line
if (len(values) and (is_string(values[0])) and (values[0] == 'Step')):
log.write_log(' column headers found at line {:d}. Reading data...'.format(nlines))
Expand Down
2 changes: 1 addition & 1 deletion sportran/i_o/read_tablefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _read_ckeys(self, group_vectors=True):
line = self.file.readline()
if len(line) == 0: # EOF
raise RuntimeError('Reached EOF, no ckeys found.')
values = np.array(line.split())
values = line.split()
# text line: read variables names and save indexes in ckey
if (is_string(values[0]) and (values[0].find('#') < 0)):
self.header += line[:-1]
Expand Down
25 changes: 11 additions & 14 deletions sportran/plotter/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ def plot_cospectrum_component(current, idx1, idx2, *, axis=None, FIGSIZE=None, f
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color1 = next(iter_colors)
color2 = next(iter_colors)
axis.plot(current.freqs_THz, np.real(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5, c=color1,)
axis.plot(current.freqs_THz, np.imag(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5, c=color2,)
axis.plot(current.freqs_THz, np.real(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5)
axis.plot(current.freqs_THz, np.imag(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5)

if f_THz_max is None:
f_THz_max = current.freqs_THz[_index_cumsum(np.abs(current.fcospectrum[idx1][idx2]), 0.95)]
Expand Down Expand Up @@ -192,8 +190,8 @@ def plot_ck(current, *, axis=None, label=None, FIGSIZE=None):

if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(iter_colors)
axis.plot(current.cepf.logpsdK, 'o-', c=color, label=label)
l, = axis.plot(current.cepf.logpsdK, 'o-', label=label)
color = l.get_color()

axis.plot(current.cepf.logpsdK + current.cepf.logpsdK_THEORY_std, '--', c=color)
axis.plot(current.cepf.logpsdK - current.cepf.logpsdK_THEORY_std, '--', c=color)
Expand All @@ -216,10 +214,10 @@ def plot_L0_Pstar(current, *, axis=None, label=None, FIGSIZE=None):
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(iter_colors) # quick fix to avoid error with mlp>=3.8
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau, '.-', c=color, label=label)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau + current.cepf.logtau_THEORY_std, '--', c=color,)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau - current.cepf.logtau_THEORY_std, '--', c=color,)
l, = axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau, '.-', label=label)
color = l.get_color()
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau + current.cepf.logtau_THEORY_std, '--', c=color)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau - current.cepf.logtau_THEORY_std, '--', c=color)
axis.axvline(x=current.cepf.aic_Kmin + 1, ls=':', c=color)
axis.axvline(x=current.cepf.cutoffK + 1, ls='--', c=color)
axis.set_xlim([0, 3 * current.cepf.cutoffK])
Expand All @@ -246,12 +244,11 @@ def plot_kappa_Pstar(current, *, axis=None, label=None, FIGSIZE=None, pstar_max=
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(iter_colors)
l, = axis.plot(np.arange(current.NFREQS) + 1, current.cepf.tau * current.KAPPA_SCALE * 0.5, 'o-', label=label)
color = l.get_color()
axis.fill_between(
np.arange(current.NFREQS) + 1, (current.cepf.tau - current.cepf.tau_THEORY_std) * current.KAPPA_SCALE * 0.5,
(current.cepf.tau + current.cepf.tau_THEORY_std) * current.KAPPA_SCALE * 0.5, alpha=0.3, color=color,
)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.tau * current.KAPPA_SCALE * 0.5, 'o-', c=color, label=label,)
(current.cepf.tau + current.cepf.tau_THEORY_std) * current.KAPPA_SCALE * 0.5, alpha=0.3, color=color)
axis.axvline(x=current.cepf.aic_Kmin + 1, ls=':', c=color)
axis.axvline(x=current.cepf.cutoffK + 1, ls='--', c=color)
axis.axhline(y=current.kappa, ls='--', c=color)
Expand Down
3 changes: 0 additions & 3 deletions tests/README.md

This file was deleted.

0 comments on commit 93fcc47

Please sign in to comment.