From de7a3a0dd8b2afd95ef2ebdbb886943590157948 Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 10 Dec 2024 14:13:08 +0100 Subject: [PATCH 1/5] use only last block for pressure convergence --- calphy/phase.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/calphy/phase.py b/calphy/phase.py index 294d9c0..38d6c89 100644 --- a/calphy/phase.py +++ b/calphy/phase.py @@ -598,8 +598,12 @@ def process_pressure(self,): #now we can check if it converted file = os.path.join(self.simfolder, "avg.dat") - lx, ly, lz, ipress = np.loadtxt(file, usecols=(1, 2, 3, 4), unpack=True) - lxpc = ipress + #we have to clean the data, so as just the last block is selected + lx, ly, lz, lxpc = np.loadtxt(file, usecols=(1, 2, 3, 4), unpack=True) + lx = lx[-ncount+1:] + ly = ly[-ncount+1:] + lz = lx[-ncount+1:] + lxpc = lxpc[-ncount+1:] mean = np.mean(lxpc) std = np.std(lxpc) volatom = np.mean((lx*ly*lz)/self.natoms) @@ -612,16 +616,20 @@ def finalise_pressure(self,): ncount = int(self.calc.md.n_small_steps)//int(self.calc.md.n_every_steps*self.calc.md.n_repeat_steps) file = os.path.join(self.simfolder, "avg.dat") - lx, ly, lz, ipress = np.loadtxt(file, usecols=(1, 2, 3, 4), unpack=True) - lxpc = ipress + lx, ly, lz, lxpc = np.loadtxt(file, usecols=(1, 2, 3, 4), unpack=True) + lx = lx[-ncount+1:] + ly = ly[-ncount+1:] + lz = lx[-ncount+1:] + lxpc = lxpc[-ncount+1:] + mean = np.mean(lxpc) std = np.std(lxpc) volatom = np.mean((lx*ly*lz)/self.natoms) self.calc._pressure = mean - self.lx = np.round(np.mean(lx[-ncount+1:]), decimals=3) - self.ly = np.round(np.mean(ly[-ncount+1:]), decimals=3) - self.lz = np.round(np.mean(lz[-ncount+1:]), decimals=3) + self.lx = np.round(np.mean(lx), decimals=3) + self.ly = np.round(np.mean(ly), decimals=3) + self.lz = np.round(np.mean(lz), decimals=3) self.volatom = volatom self.vol = self.lx*self.ly*self.lz self.rho = self.natoms/(self.lx*self.ly*self.lz) From 69251f5da0e0451e092c89a4675b75e2763b55ee Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 10 Dec 2024 14:16:05 +0100 Subject: [PATCH 2/5] =?UTF-8?q?Bump=20version:=201.3.12=20=E2=86=92=201.3.?= =?UTF-8?q?13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- calphy/__init__.py | 2 +- calphy/input.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5553454..625a656 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.3.12 +current_version = 1.3.13 commit = True tag = True diff --git a/calphy/__init__.py b/calphy/__init__.py index 7e57954..a118409 100644 --- a/calphy/__init__.py +++ b/calphy/__init__.py @@ -4,7 +4,7 @@ from calphy.alchemy import Alchemy from calphy.routines import MeltingTemp -__version__ = "1.3.12" +__version__ = "1.3.13" def addtest(a,b): return a+b diff --git a/calphy/input.py b/calphy/input.py index ca06786..0f21701 100644 --- a/calphy/input.py +++ b/calphy/input.py @@ -40,7 +40,7 @@ from ase.io import read, write import shutil -__version__ = "1.3.12" +__version__ = "1.3.13" def _check_equal(val): if not (val[0]==val[1]==val[2]): diff --git a/setup.py b/setup.py index bdc761a..e43417c 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ packages=find_packages(include=['calphy', 'calphy.*']), test_suite='tests', url='https://github.com/ICAMS/calphy', - version='1.3.12', + version='1.3.13', zip_safe=False, entry_points={ 'console_scripts': [ From 6eb8ba817a4d49fd188151b48fa625a954ee97f3 Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 10 Dec 2024 14:19:38 +0100 Subject: [PATCH 3/5] update actions --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fa94190..b188728 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -18,9 +18,9 @@ jobs: label: linux-64-py-3-9 prefix: /usr/share/miniconda3/envs/my-env steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} miniforge-variant: Mambaforge From 1d8a83218bb15fc617087721cf4e0044e2de3a54 Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 10 Dec 2024 14:23:55 +0100 Subject: [PATCH 4/5] modernise unittesting --- .github/workflows/testing.yml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b188728..9c2faac 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,33 +14,16 @@ jobs: matrix: include: - operating-system: ubuntu-latest - python-version: 3.9 - label: linux-64-py-3-9 - prefix: /usr/share/miniconda3/envs/my-env + python-version: 3.11 steps: - uses: actions/checkout@v4 - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@v4 with: python-version: ${{ matrix.python-version }} - miniforge-variant: Mambaforge + miniforge-version: latest channels: conda-forge - channel-priority: strict - activate-environment: my-env - use-mamba: true - - name: Set cache date and number - run: | - echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV - cat .github/variables/cache_number.env >> $GITHUB_ENV - - uses: actions/cache@v2 - with: - path: ${{ matrix.prefix }} - key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} - id: cache - - name: Update environment - run: mamba env update -n my-env -f environment.yml - if: steps.cache.outputs.cache-hit != 'true' - + environment-file: environment.yml - name: run tests shell: bash -l {0} run: | From 3076e3aa79c45ef2bfc26aa71e3c87037db5915e Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 10 Dec 2024 14:24:43 +0100 Subject: [PATCH 5/5] fix wrong miniconda version --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9c2faac..848a266 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v4 + uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} miniforge-version: latest