質問編集履歴

5

誤字

2018/10/26 04:33

投稿

donarudo
donarudo

スコア15

test CHANGED
File without changes
test CHANGED
@@ -408,7 +408,9 @@
408
408
 
409
409
  def output_dailyrun(self, initialize=False):
410
410
 
411
-
411
+ out = self.out
412
+
413
+ ops = self.model
412
414
 
413
415
  if not initialize:
414
416
 

4

誤字

2018/10/26 04:33

投稿

donarudo
donarudo

スコア15

test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ### 発生したエラーメッセージ
8
8
 
9
- File "/Users/admin/PycharmProjects/PySawit-master-hamaguchi/facade.py", line 502, in output_dailyrun
9
+ line 502, in output_dailyrun
10
10
 
11
11
  out['pF'] = ops.rootwater.pF
12
12
 

3

プログラムの修正

2018/10/26 04:29

投稿

donarudo
donarudo

スコア15

test CHANGED
File without changes
test CHANGED
@@ -6,6 +6,10 @@
6
6
 
7
7
  ### 発生したエラーメッセージ
8
8
 
9
+ File "/Users/admin/PycharmProjects/PySawit-master-hamaguchi/facade.py", line 502, in output_dailyrun
10
+
11
+ out['pF'] = ops.rootwater.pF
12
+
9
13
  AttributeError: 'RootWater' object has no attribute 'pF'
10
14
 
11
15
  ### 該当するソースコード
@@ -398,6 +402,84 @@
398
402
 
399
403
  ```
400
404
 
405
+ ```
406
+
407
+ #facade.py
408
+
409
+ def output_dailyrun(self, initialize=False):
410
+
411
+
412
+
413
+ if not initialize:
414
+
415
+ # 1. get results for daily properties:
416
+
417
+ ag_growth = ops.parts.pinnae.growth + ops.parts.rachis.growth + ops.parts.trunk.growth
418
+
419
+ veg_growth = ag_growth + ops.parts.roots.growth
420
+
421
+ out['age'] = ops.treeage
422
+
423
+ out['tmin'] = ops.daytmin
424
+
425
+ out['tmax'] = ops.daytmax
426
+
427
+ out['totalrad'], out['directrad'], out['diffuserad'] = ops.dayrad
428
+
429
+ out['wind'] = ops.daywind
430
+
431
+ out['rain'] = ops.dayrain
432
+
433
+ out['netrain'] = ops.netrain
434
+
435
+ out['ambientCO2'] = ops.co2ambient
436
+
437
+ out['LAI'] = ops.lai
438
+
439
+ out['pinnae'] = ops.parts.pinnae.weight
440
+
441
+ out['rachis'] = ops.parts.rachis.weight
442
+
443
+ out['trunk'] = ops.parts.trunk.weight
444
+
445
+ out['roots'] = ops.parts.roots.weight
446
+
447
+ out['male'] = ops.parts.maleflo.weight
448
+
449
+ out['female'] = ops.parts.femaflo.weight
450
+
451
+ out['bunches'] = ops.parts.bunches.weight
452
+
453
+ out['flowersex'] = ops.flowersex
454
+
455
+ out['VDM'] = ops.vdmwgt
456
+
457
+ out['TDM'] = ops.tdmwgt
458
+
459
+ out['assim_photosyn'] = ops.dayassim
460
+
461
+ out['assim_maint'] = ops.assim4maint
462
+
463
+ out['assim_growth'] = ops.assim4growth
464
+
465
+ out['assim_gen'] = ops.assim4gen
466
+
467
+ out['VDM_growth'] = ag_growth
468
+
469
+ out['TDM_growth'] = veg_growth
470
+
471
+ out['yield'] = ops.bunchyield
472
+
473
+ out['trunk_hgt'] = ops.trunkhgt
474
+
475
+ out['rootdepth'] = ops.rootdepth
476
+
477
+ out['rootzone_VWC'] = ops.rootwater.vwc
478
+
479
+ out['pF'] = ops.rootwater.pF
480
+
481
+ ```
482
+
401
483
  上記のソースコードのhmの値からpF値を求めたいと思ってますが、エラーが出て困っています。
402
484
 
403
485
  ご指摘をお願いします。

2

プログラム修正

2018/10/26 04:27

投稿

donarudo
donarudo

スコア15

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,33 @@
12
12
 
13
13
  ```lang-Python3
14
14
 
15
-
15
+ class RootWater(object):
16
+
17
+ def __init__(self):
18
+
19
+ """
20
+
21
+ Create and initialize the RootWater object.
22
+
23
+
24
+
25
+ """
26
+
27
+ self.wc = 0.0 # water content (mm)
28
+
29
+ self.vwc = 0.0 # water content (m3/m3)
30
+
31
+ self.critical = 0.0 # water content, below which plant water stress occurs (m3/m3)
32
+
33
+ self.sat = 0.0 # saturation point (m3/m3)
34
+
35
+ self.fc = 0.0 # field capacity (m3/m3)
36
+
37
+ self.pwp = 0.0 # permanent wilting point (m3/m3)
38
+
39
+ self.pF = 0.0
40
+
41
+ #途中略してます
16
42
 
17
43
  def __init__(self, fname_in):
18
44
 

1

タイトルの改善

2018/10/26 04:11

投稿

donarudo
donarudo

スコア15

test CHANGED
@@ -1 +1 @@
1
- object has no attribute
1
+ Python3のエラーobject has no attribute
test CHANGED
File without changes