Skip to content

Commit

Permalink
Merge pull request #62 from DiamondLightSource/r2.0 ready for v2.0 re…
Browse files Browse the repository at this point in the history
…lease.

Brings master branch up to date with r2.0 ready for v2.0 release.
  • Loading branch information
JossWhittle authored Jul 31, 2020
2 parents 97b25f2 + 58b6843 commit b3e4dd9
Show file tree
Hide file tree
Showing 127 changed files with 488,161 additions and 44,576 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ ENV/

# Rope project settings
.ropeproject

# Autogenerated mpi shell scripts
IDSort/src/mpijob.sh
IDSort/src/mpi4shimOpt.sh
3 changes: 3 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ build:
- sudo apt-get update
- sudo apt-get -y install libopenmpi-dev
- sudo apt-get -y install openmpi-bin
environment:
python:
version: "3.7"
filter:
excluded_paths:
- '*/test/*'
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "2.7"
- "3.7"

before_install:
- sudo apt-get update
Expand All @@ -12,7 +12,7 @@ install:
- pip install coveralls coverage

script:
- python -m pytest --cov=IDSort --log-format='%(asctime)s.%(msecs)03d %(filename)-25s %(lineno)4d %(levelname)-8s %(message)s' --log-date-format='%Y-%m-%d %H:%M:%S' IDSort/test
- python -m pytest --cov=IDSort --log-format='%(asctime)s.%(msecs)03d %(levelname)8s | %(threadName)s | %(module)s::%(funcName)s::%(lineno)-4d | %(message)s' IDSort/test

after_script:
- coveralls
2 changes: 1 addition & 1 deletion IDSort/data/test_data
Submodule test_data updated 45 files
+ shim/1.00000000e+00_001_test.genome
+ shim/1.20847271e-07_000_85a13cc425d0.genome
+ shim/1.20847271e-07_000_A85a13cc425d0.genome
+ shim/1.20952907e-07_000_9228436240f4.genome
+ shim/1.20952907e-07_000_A9228436240f4.genome
+ shim/1.20965365e-07_000_763473ed8598.genome
+ shim/1.20965365e-07_000_A763473ed8598.genome
+0 −13 shim/1.21718320e-07_000_5bd3ebe937ee.genome
+0 −10,135 shim/1.21718320e-07_000_A5bd3ebe937ee.genome
+0 −10,135 shim/1.21768535e-07_000_Acd5fba3a36ae.genome
+0 −13 shim/1.21768535e-07_000_cd5fba3a36ae.genome
+0 −14 shim/1.21818136e-07_000_5ff34ab877e0.genome
+0 −10,135 shim/1.21818136e-07_000_A5ff34ab877e0.genome
+ shim/1.23262940e-07_000_3fa353e9cf87.genome
+0 −14 shim/1.23936830e-07_000_8bcddb88074d.genome
+ shim/test-A5bd3ebe937ee.h5
+ shim/test-A5ff34ab877e0.h5
+ shim/test-A763473ed8598.h5
+ shim/test-A85a13cc425d0.h5
+ shim/test-A9228436240f4.h5
+ shim/test-Acd5fba3a36ae.h5
+2 −2 shim/test_shim.txt
+0 −10,135 sort/1.07788212e-08_000_c0833a96b82c.genome.inp.genome
+ sort/1.12875826e-08_000_7c51ecd01f73.genome.inp.genome
+0 −10,135 sort/mpi_runner_initial_population/1.07788212e-08_001_c0833a96b82c.genome
+ sort/mpi_runner_initial_population/1.09170425e-08_000_88d39698a4f7.genome
+ sort/mpi_runner_initial_population/6.42786056e-09_000_aaf866db3206.genome
+ sort/mpi_runner_initial_population/7.03009938e-09_000_a90b37ecedb9.genome
+ sort/mpi_runner_initial_population/7.06840992e-09_000_a12a86932596.genome
+0 −10,135 sort/mpi_runner_initial_population/8.62681680e-09_000_5ffd95460060.genome
+0 −10,135 sort/mpi_runner_initial_population/8.86225773e-09_000_910c79ca1fc4.genome
+0 −10,135 sort/mpi_runner_initial_population/9.90050079e-09_000_5c3b9f36eca8.genome
+0 −10,135 sort/mpi_runner_output/1.07788212e-08_000_c0833a96b82c.genome
+ sort/mpi_runner_output/1.12875826e-08_000_7c51ecd01f73.genome
+0 −10,135 sort/mpi_runner_output/1.13540850e-08_000_98451f1c78c2.genome
+0 −10,135 sort/mpi_runner_output/1.49284583e-08_000_92fab60b32fe.genome
+ sort/mpi_runner_output/1.49788342e-08_000_b6059e1c0884.genome
+ sort/mpi_runner_output/1.81441854e-08_000_645a52b2bb2d.genome
+0 −10,135 sort/mpi_runner_output/1.93191576e-08_000_d67a4cf9dfac.genome
+ sort/mpi_runner_output/4.05007630e-08_000_47a4f43ecf86.genome
+ sort/process_genome_analyse_output/1.07788212e-08_000_c0833a96b82c.genome.h5
+0 −462 sort/process_genome_analyse_output/1.07788212e-08_000_c0833a96b82c.genome.inp
+ sort/process_genome_analyse_output/1.12875826e-08_000_7c51ecd01f73.genome.h5
+462 −0 sort/process_genome_analyse_output/1.12875826e-08_000_7c51ecd01f73.genome.inp
+ sort/test_cpmu.mag
56 changes: 56 additions & 0 deletions IDSort/example_configs/shim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
id_setup:
periods: 113
fullmagdims:
- 50.0
- 30.0
- 5.76
hemagdims:
- 50.0
- 30.0
- 4.00
htmagdims:
- 50.0
- 30.0
- 1.13
poledims:
- 30.0
- 23.0
- 2.95
interstice: 0.0625
gap: 5.6
type: 'Hybrid_Symmetric'
name: 'test_cpmu_shim'
x:
- 0
- 0.1
- 1
z:
- 0
- 0.1
- 1
steps: 1
endgapsym: 3.0
terminalgapsymhyb: 3.0
output_filename: 'test_cpmu_shim.json'
magnets:
hmags: '/path/to/Opt-ID/IDSort/data/I03H.sim'
hemags: '/path/to/Opt-ID/IDSort/data/I03HEC.sim'
htmags: '/path/to/Opt-ID/IDSort/data/I03HTE.sim'
vmags: null
vemags: null
output_filename: 'test_cpmu_shim.mag'
lookup_generator:
random: False
output_filename: 'test_cpmu_shim.h5'
process_genome:
readable_genome_file: '/path/to/Opt-ID/IDSort/data/test_data/sort/process_genome_analyse_output/1.12875826e-08_000_7c51ecd01f73.genome.inp'
mpi_runner_for_shim_opt:
iterations: 3
setup: 24
c: 1
e: 0.0
max_age: 10
scale: 10.0
bfield_filename: '/path/to/measured_h5_data'
number_of_changes: 2
number_of_mutations: 5
57 changes: 57 additions & 0 deletions IDSort/example_configs/shim_z.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
id_setup:
periods: 113
fullmagdims:
- 50.0
- 30.0
- 5.76
hemagdims:
- 50.0
- 30.0
- 3.48
htmagdims:
- 50.0
- 30.0
- 0.87
poledims:
- 30.0
- 26.0
- 2.96
interstice: 0.04
gap: 5.1
type: 'Hybrid_Symmetric'
name: 'test_cpmu_shim'
x:
- -2.0
- 2.1
- 2.5
z:
- -0.0
- 0.1
- 0.1
steps: 1
endgapsym: 5.0
terminalgapsymhyb: 5.0
output_filename: 'test_cpmu_shim.json'
magnets:
hmags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03H.sim'
hemags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03HEC.sim'
htmags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03HTE.sim'
vmags: null
vemags: null
output_filename: 'test_cpmu_shim.mag'
lookup_generator:
random: False
output_filename: 'test_cpmu_shim.h5'
process_genome:
readable_genome_file:
- '/dls/tmp/tow31676/process_genome_output/1.05309977e-08_000_271af39f14c4.genome.inp'
mpi_runner_for_shim_opt:
iterations: 3
setup: 24
c: 1
e: 0.0
max_age: 10
scale: 10.0
bfield_filename: '/dls/tmp/tow31676/process_genome_output/1.24536593e-08_000_51a7950f9b7f.genome.h5'
number_of_changes: 2
number_of_mutations: 5
51 changes: 51 additions & 0 deletions IDSort/example_configs/sort.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
id_setup:
periods: 113
fullmagdims:
- 50.0
- 30.0
- 5.76
hemagdims:
- 50.0
- 30.0
- 3.48
htmagdims:
- 50.0
- 30.0
- 0.87
poledims:
- 30.0
- 26.0
- 2.96
interstice: 0.04
gap: 5.1
type: 'Hybrid_Symmetric'
name: 'test_cpmu'
x:
- -2.0
- 2.1
- 2.5
z:
- -0.0
- 0.1
- 0.1
steps: 1
endgapsym: 5.0
terminalgapsymhyb: 5.0
output_filename: 'test_cpmu.json'
magnets:
hmags: '/path/to/Opt-ID/IDSort/data/I03H.sim'
hemags: '/path/to/Opt-ID/IDSort/data/I03HEC.sim'
htmags: '/path/to/Opt-ID/IDSort/data/I03HTE.sim'
vmags: null
vemags: null
output_filename: 'test_cpmu.mag'
lookup_generator:
random: False
output_filename: 'test_cpmu.h5'
mpi_runner:
iterations: 3
setup: 24
c: 1
e: 0.0
max_age: 10
scale: 10.0
51 changes: 51 additions & 0 deletions IDSort/example_configs/sort_z.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
id_setup:
periods: 113
fullmagdims:
- 50.0
- 30.0
- 5.76
hemagdims:
- 50.0
- 30.0
- 3.48
htmagdims:
- 50.0
- 30.0
- 0.87
poledims:
- 30.0
- 26.0
- 2.96
interstice: 0.04
gap: 5.1
type: 'Hybrid_Symmetric'
name: 'test_cpmu'
x:
- -2.0
- 2.1
- 2.5
z:
- -0.0
- 0.1
- 0.1
steps: 1
endgapsym: 5.0
terminalgapsymhyb: 5.0
output_filename: 'test_cpmu.json'
magnets:
hmags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03H.sim'
hemags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03HEC.sim'
htmags: '/home/tow31676/id_sort_code/Opt-ID/IDSort/data/I03HTE.sim'
vmags: null
vemags: null
output_filename: 'test_cpmu.mag'
lookup_generator:
random: False
output_filename: 'test_cpmu.h5'
mpi_runner:
iterations: 3
setup: 24
c: 1
e: 0.0
max_age: 10
scale: 10.0
20 changes: 11 additions & 9 deletions IDSort/src/Opt-ID.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

import sys
import os
import magnets
import genome_tools

import random
from genome_tools import ID_BCell
import field_generator as fg
import sys

from .magnets import Magnets, MagLists
from .genome_tools import ID_BCell
from .field_generator import write_bfields

E_STAR = 0.0
M_STAR = 1.0
Expand Down Expand Up @@ -48,26 +49,27 @@ def mutations(c, e_star, fitness, scale):
(options, args) = parser.parse_args()

print("Loading magnets")
mags = magnets.Magnets()
mags = Magnets()
mags.load(options.magnets_filename)

if options.build:

for filename in args[1::]:
print("Processing file %s" % (filename))
# load the genome
genome = ID_BCell()
genome.load(filename)

outfile = os.path.join(args[0], os.path.split(filename)[1]+'.h5')
fg.output_fields(outfile, options.id_filename, options.lookup_filename,
options.magnets_filename, genome.genome);
write_bfields(outfile, options.id_filename, options.lookup_filename, options.magnets_filename, genome.genome)

sys.exit(0)

if options.setup > 0:
print("Running setup")
for i in range(options.setup):
# create a fresh maglist
maglist = magnets.MagLists(mags)
maglist = MagLists(mags)
maglist.shuffle_all()
genome = ID_BCell(options.id_filename, options.lookup_filename, options.magnets_filename)
genome.create(maglist)
Expand Down
Loading

0 comments on commit b3e4dd9

Please sign in to comment.