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/.github/workflows/testing.yml b/.github/workflows/testing.yml index fa94190..848a266 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@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 + 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: | 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/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) 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': [