opal AT lists.psi.ch
Subject: The OPAL Discussion Forum
List archive
- From: Philippe Piot <philippe.piot AT gmail.com>
- To: opal <opal AT lists.psi.ch>
- Subject: [Opal] issue reading json file from sampler w/ pyOPALTools
- Date: Wed, 12 May 2021 06:13:00 -0500
- Authentication-results: localhost; iprev=pass (mail-pl1-f180.google.com) smtp.remote-ip=209.85.214.180; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com
Dear All,
I am trying to read the attached json file (with just three samples) with the attached viewjason.py script when I load it I seem to only "see" 1 sample and a
X=ds.getData('currFoc') [see my viewjason.py]
only give me a scalar instead of a 3D vector. Thank you for any help. All the best, -- Philippe.
PS: the ds= load_dataset (...) gives after a print(ds) [I have 9 variables with 40 output recorded] and just made three samples for testing purpose.
Number of samplers: 1
Number of samples: 3 per generation
Available design variables (9) :
currFoc
currMat
gunE
gunPhi
lin1E
lin1Phi
lin1dx
lin1dy
lsrSzR
Available objectives (40) :
OBJ1
OBJ10
OBJ11
OBJ12
OBJ13
OBJ14
OBJ15
OBJ16
OBJ17
OBJ18
OBJ19
OBJ2
OBJ20
OBJ21
OBJ22
OBJ23
OBJ24
OBJ25
OBJ26
OBJ27
OBJ28
OBJ29
OBJ3
OBJ30
OBJ31
OBJ32
OBJ33
OBJ34
OBJ35
OBJ36
OBJ37
OBJ38
OBJ39
OBJ4
OBJ40
OBJ5
OBJ6
OBJ7
OBJ8
OBJ9
from opal.opal import load_dataset import matplotlib.pyplot as plt import numpy as np import sys ''' usage: python viewJson.py ML1 ML1_samples_0.json ''' filename=str(sys.argv[1]) ds = load_dataset(str(sys.argv[1])+'/', fname=str(sys.argv[2])) print (ds) X=ds.getData('currFoc') print (X)
Attachment:
ML1_samples_0.json
Description: application/json
-
[Opal] issue reading json file from sampler w/ pyOPALTools,
Philippe Piot, 05/12/2021
- Re: [Opal] issue reading json file from sampler w/ pyOPALTools, Adelmann Andreas (PSI), 05/12/2021
Archive powered by MHonArc 2.6.19.