Skip to content

Commit 1da6ead

Browse files
Merge branch 'develop' of ssh://github.com/westpa/westpa into westpa3
2 parents 5e1d455 + 463f246 commit 1da6ead

File tree

17 files changed

+130
-32
lines changed

17 files changed

+130
-32
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
release:
1717
types:
1818
- published
19+
workflow_dispatch:
20+
branches:
21+
- 'westpa2'
22+
- 'develop'
1923

2024
jobs:
2125
build_wheels:
@@ -33,7 +37,7 @@ jobs:
3337
run: "brew install hdf5"
3438

3539
- name: Build wheels
36-
uses: pypa/cibuildwheel@v2.23.0
40+
uses: pypa/cibuildwheel@v2.23.3
3741
env:
3842
CIBW_SKIP: "pp* *-musllinux*"
3943
CIBW_BUILD: "cp3${{ matrix.python-version }}-*"
@@ -112,7 +116,7 @@ jobs:
112116
# alternatively, to publish when a GitHub Release is created, use the following rule:
113117
if: |
114118
github.repository == 'westpa/westpa' &&
115-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
119+
(github.event_name == 'release' && github.event.action == 'published')
116120
steps:
117121
- uses: actions/download-artifact@v4
118122
with:
@@ -128,7 +132,7 @@ jobs:
128132

129133
upload_pypi:
130134
name: PyPI
131-
needs: [build_wheels, build_sdist]
135+
needs: [upload_testpypi]
132136
runs-on: ubuntu-latest
133137
environment:
134138
name: pypi

.github/workflows/mirror.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ on:
55
# Once a month on the 28th day at 4 pm UTC, which is ~11 am EST.
66
- cron: "00 16 28 * *"
77
workflow_dispatch:
8+
branches:
9+
- 'westpa2'
810

911
jobs:
1012
mirror-develop-to-westpa2:
1113
runs-on: ubuntu-latest
1214
name: Mirror develop branch to westpa2 branch
15+
if: github.repository_owner == 'westpa'
1316
steps:
14-
- uses: actions/create-github-app-token@v1
17+
- uses: actions/create-github-app-token@v2
1518
id: app-token
1619
with:
1720
app-id: ${{ vars.BRANCH_MIRROR_APPID }}

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
# Scheduled workflows run on the latest commit on the default or base branch.
1717
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
1818
- cron: "30 15 * * 4"
19+
workflow_dispatch:
20+
branches:
21+
- 'westpa2'
22+
- 'develop'
1923

2024
jobs:
2125
lint:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
| doc
2020
)
2121
- repo: https://github.com/pycqa/flake8
22-
rev: 7.1.2
22+
rev: 7.2.0
2323
hooks:
2424
- id: flake8
2525
exclude: >

src/westpa/cli/tools/w_assign.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,16 @@ def load_config_from_west(self, scheme):
340340
from westpa.core._rc import bins_from_yaml_dict
341341

342342
self.binning.mapper = bins_from_yaml_dict(config['analysis_schemes'][scheme]['bins'][0])
343+
344+
# Output file/folder wrangling
343345
path = os.path.join(os.getcwd(), config['directory'], scheme)
346+
self.output_filename = os.path.join(path, 'assign.h5')
347+
344348
try:
345-
os.mkdir(config['directory'])
346-
os.mkdir(path)
349+
os.makedirs(path, exist_ok=True)
347350
except Exception:
348351
pass
349352

350-
self.output_filename = os.path.join(path, 'assign.h5')
351-
352353
def load_state_file(self, state_filename):
353354
import yaml
354355

src/westpa/cli/tools/w_direct.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ def w_kinavg(self):
302302
self.output_file.replace_dataset('target_flux_evolution', data=rate_evol, shuffle=True, compression=9)
303303

304304
def go(self):
305+
# Have class inherit user-provided self.output_filename as self.kinetics_filename
306+
self.kinetics_filename = self.output_filename
307+
305308
pi = self.progress.indicator
306309
with pi:
307310
self.w_kinavg()
@@ -474,6 +477,9 @@ def w_stateprobs(self):
474477
self.output_file.replace_dataset(name='state_pop_evolution', data=pop_evol, shuffle=True, compression=9)
475478

476479
def go(self):
480+
# Have class inherit user-provided self.output_filename as self.kinetics_filename
481+
self.kinetics_filename = self.output_filename
482+
477483
pi = self.progress.indicator
478484
with pi:
479485
self.w_stateprobs()
@@ -498,8 +504,9 @@ class DAll(DStateProbs, DKinAvg, DKinetics):
498504
'''
499505

500506
def go(self):
501-
# One minor issue; as this stands now, since it's inheriting from all the other classes, it needs
502-
# a kinetics file to instantiate the other attributes. We'll need to modify how the loading works, there.
507+
# Have class inherit user-provided self.output_filename as self.kinetics_filename
508+
self.kinetics_filename = self.output_filename
509+
503510
pi = self.progress.indicator
504511
with pi:
505512
self.w_kinetics()
@@ -526,6 +533,9 @@ class DAverage(DStateProbs, DKinAvg):
526533
'''
527534

528535
def go(self):
536+
# Have class inherit user-provided self.output_filename as self.kinetics_filename
537+
self.kinetics_filename = self.output_filename
538+
529539
pi = self.progress.indicator
530540
with pi:
531541
self.w_kinavg()

src/westpa/cli/tools/w_ipa.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def __init__(self):
7878
# Well, whatever, we'll just set it to that for now.
7979
self.interface = 'matplotlib'
8080
self._scheme = None
81-
global iteration
8281

8382
def add_args(self, parser):
8483
self.progress.add_args(parser)

src/westpa/core/data_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
evolves.
2525
2626
Version history:
27+
Version 10
28+
- BinMapper pickle, hash, and bin_target_count are now saved for iteration 1
2729
Version 9
2830
- Basis states are now saved as iter_segid instead of just segid as a pointer label.
2931
- Initial states are also saved in the iteration 0 file, with a negative sign.
@@ -66,7 +68,7 @@
6668

6769
log = logging.getLogger(__name__)
6870

69-
file_format_version = 9
71+
file_format_version = 10
7072

7173
makepath = ExecutablePropagator.makepath
7274

src/westpa/core/sim_manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,13 @@ def initialize_simulation(self, basis_states, target_states, start_states, segs_
437437
# Send the segments over to the data manager to commit to disk
438438
data_manager.current_iteration = 1
439439

440+
# Save BinMapper stuff for iteration 1
441+
try:
442+
pickled, hashed = self.we_driver.bin_mapper.pickle_and_hash()
443+
except PickleError:
444+
pickled = hashed = ''
445+
data_manager.save_iter_binning(data_manager.current_iteration, hashed, pickled, target_counts)
446+
440447
# Report statistics
441448
pstatus('Simulation prepared.')
442449
self.segments = {segment.seg_id: segment for segment in segments}

src/westpa/oldtools/aframe/plotting.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import logging
23

34
import numpy as np
@@ -76,15 +77,12 @@
7677

7778
class PlottingMixin(AnalysisMixin):
7879
def __init__(self):
79-
global matplotlib, pyplot
80-
8180
super().__init__()
8281

83-
self.matplotlib_avail = matplotlib is not None and pyplot is not None
82+
self.matplotlib_avail = 'matplotlib' in sys.modules and 'matplotlib.pyplot' in sys.modules
8483

8584
def require_matplotlib(self):
86-
global matplotlib
8785
if not self.matplotlib_avail:
8886
raise RuntimeError('matplotlib is not available')
8987
else:
90-
return matplotlib
88+
return sys.modules['matplotlib']

0 commit comments

Comments
 (0)