gea-program 0.45.0__tar.gz → 0.47.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. {gea_program-0.45.0 → gea_program-0.47.0}/PKG-INFO +25 -1
  2. {gea_program-0.45.0 → gea_program-0.47.0}/README.md +24 -0
  3. {gea_program-0.45.0 → gea_program-0.47.0}/gea/__init__.py +1 -1
  4. {gea_program-0.45.0 → gea_program-0.47.0}/gea/__main__.py +96 -0
  5. {gea_program-0.45.0 → gea_program-0.47.0}/gea/acceptance_tests.py +305 -0
  6. gea_program-0.47.0/gea/help/invoice-check.md +15 -0
  7. gea_program-0.47.0/gea/help/rig-time.md +15 -0
  8. {gea_program-0.45.0 → gea_program-0.47.0}/gea/helplib.py +3 -1
  9. gea_program-0.47.0/gea/invoice_check.py +796 -0
  10. gea_program-0.47.0/gea/rig_state.py +651 -0
  11. {gea_program-0.45.0 → gea_program-0.47.0}/gea/service.py +41 -0
  12. {gea_program-0.45.0 → gea_program-0.47.0}/gea/web/app.html +88 -1
  13. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/PKG-INFO +25 -1
  14. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/SOURCES.txt +4 -0
  15. {gea_program-0.45.0 → gea_program-0.47.0}/pyproject.toml +1 -1
  16. {gea_program-0.45.0 → gea_program-0.47.0}/LICENSE +0 -0
  17. {gea_program-0.45.0 → gea_program-0.47.0}/gea/BENCH_TEST_PROTOCOL.md +0 -0
  18. {gea_program-0.45.0 → gea_program-0.47.0}/gea/accuracy_statement.py +0 -0
  19. {gea_program-0.45.0 → gea_program-0.47.0}/gea/alarm_engine.py +0 -0
  20. {gea_program-0.45.0 → gea_program-0.47.0}/gea/alerts.py +0 -0
  21. {gea_program-0.45.0 → gea_program-0.47.0}/gea/backup.py +0 -0
  22. {gea_program-0.45.0 → gea_program-0.47.0}/gea/bench.py +0 -0
  23. {gea_program-0.45.0 → gea_program-0.47.0}/gea/blind_harness.py +0 -0
  24. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/acex_lomonosov_age_depth_model.provenance.json +0 -0
  25. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/acex_lomonosov_age_depth_model.txt +0 -0
  26. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/agassiz77_canada_temperature.csv +0 -0
  27. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/agassiz77_canada_temperature.provenance.json +0 -0
  28. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/barbados_110_consolidation.provenance.json +0 -0
  29. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/barbados_110_consolidation.txt +0 -0
  30. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/bengal_u1452_grain_size.provenance.json +0 -0
  31. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/bengal_u1452_grain_size.txt +0 -0
  32. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/blake_164_methane_isotopes.provenance.json +0 -0
  33. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/blake_164_methane_isotopes.txt +0 -0
  34. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/chicxulub_m0077a_pwave_velocity.provenance.json +0 -0
  35. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/chicxulub_m0077a_pwave_velocity.txt +0 -0
  36. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/collingwood_1_28_ks_complete.las +0 -0
  37. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/collingwood_1_28_ks_complete.provenance.json +0 -0
  38. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/costa_rica_odp_friction_envelope.provenance.json +0 -0
  39. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/costa_rica_odp_friction_envelope.txt +0 -0
  40. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dead_sea_5017_debrite_xrf_ms.provenance.json +0 -0
  41. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dead_sea_5017_debrite_xrf_ms.txt +0 -0
  42. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dsdp_504b_physical_properties.provenance.json +0 -0
  43. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dsdp_504b_physical_properties.txt +0 -0
  44. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dsdp_504b_sound_velocity.provenance.json +0 -0
  45. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/dsdp_504b_sound_velocity.txt +0 -0
  46. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/elgygytgyn_5011_turbidites.provenance.json +0 -0
  47. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/elgygytgyn_5011_turbidites.txt +0 -0
  48. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/epica_domec_co2_800kyr.provenance.json +0 -0
  49. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/epica_domec_co2_800kyr.txt +0 -0
  50. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/fram_909_organic_petrography.provenance.json +0 -0
  51. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/fram_909_organic_petrography.txt +0 -0
  52. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gbr_325_coral_uth_ages.provenance.json +0 -0
  53. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gbr_325_coral_uth_ages.txt +0 -0
  54. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gisp2_greenland_temperature.csv +0 -0
  55. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gisp2_greenland_temperature.provenance.json +0 -0
  56. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gom_308_t2p_insitu.provenance.json +0 -0
  57. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/gom_308_t2p_insitu.txt +0 -0
  58. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/guaymas_385_dom_d13c.provenance.json +0 -0
  59. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/guaymas_385_dom_d13c.txt +0 -0
  60. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/hikurangi_u1520_friction_insitu.provenance.json +0 -0
  61. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/hikurangi_u1520_friction_insitu.txt +0 -0
  62. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/hydrate_ridge_204_ncr_hydrate.provenance.json +0 -0
  63. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/hydrate_ridge_204_ncr_hydrate.txt +0 -0
  64. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/iodp_u1324_pore_pressure.provenance.json +0 -0
  65. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/iodp_u1324_pore_pressure.txt +0 -0
  66. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/jfast_c0019_slow_slip_events.provenance.json +0 -0
  67. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/jfast_c0019_slow_slip_events.txt +0 -0
  68. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/kennetcook_2_p129_excerpt.las +0 -0
  69. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/kennetcook_2_p129_excerpt.provenance.json +0 -0
  70. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_bhgm_density.dat +0 -0
  71. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_bhgm_density.provenance.json +0 -0
  72. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_complog_6020_excerpt.provenance.json +0 -0
  73. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_complog_6020_excerpt.txt +0 -0
  74. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_hlog246_temperature.dat +0 -0
  75. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_hlog246_temperature.provenance.json +0 -0
  76. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_rockmech_compress.dat +0 -0
  77. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_rockmech_compress.provenance.json +0 -0
  78. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_tvd_0_9080_excerpt.dat +0 -0
  79. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_hb_tvd_0_9080_excerpt.provenance.json +0 -0
  80. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_vb_rockmech_compress.dat +0 -0
  81. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_vb_rockmech_compress.provenance.json +0 -0
  82. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_vb_vlog251_temperature.dat +0 -0
  83. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ktb_vb_vlog251_temperature.provenance.json +0 -0
  84. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/l06_06_nl_survey.csv +0 -0
  85. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/l06_06_nl_survey.provenance.json +0 -0
  86. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/l07_01_nl_excerpt.las +0 -0
  87. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/l07_01_nl_excerpt.provenance.json +0 -0
  88. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/mariana_1200_serpentinite_geochem.provenance.json +0 -0
  89. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/mariana_1200_serpentinite_geochem.txt +0 -0
  90. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/med_160_sapropels.provenance.json +0 -0
  91. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/med_160_sapropels.txt +0 -0
  92. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/nankai_megasplay_shear_strength.provenance.json +0 -0
  93. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/nankai_megasplay_shear_strength.txt +0 -0
  94. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1027b_thermal_conductivity.provenance.json +0 -0
  95. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1027b_thermal_conductivity.txt +0 -0
  96. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1027c_cork_temperature.provenance.json +0 -0
  97. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1027c_cork_temperature.txt +0 -0
  98. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1165b_thermal_conductivity.provenance.json +0 -0
  99. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1165b_thermal_conductivity.txt +0 -0
  100. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1274a_mantle_peridotite_mad.provenance.json +0 -0
  101. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_1274a_mantle_peridotite_mad.txt +0 -0
  102. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_504b_dike_elastic_moduli.provenance.json +0 -0
  103. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_504b_dike_elastic_moduli.txt +0 -0
  104. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_504b_leg137_borehole_fluids.provenance.json +0 -0
  105. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_504b_leg137_borehole_fluids.txt +0 -0
  106. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_735b_gabbro_elastic_moduli.provenance.json +0 -0
  107. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/odp_735b_gabbro_elastic_moduli.txt +0 -0
  108. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/peru_201_sulfate_reduction.provenance.json +0 -0
  109. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/peru_201_sulfate_reduction.txt +0 -0
  110. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/scorpio_e1_sa_excerpt.las +0 -0
  111. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/scorpio_e1_sa_excerpt.provenance.json +0 -0
  112. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/sumatra_362_cohesion.provenance.json +0 -0
  113. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/sumatra_362_cohesion.txt +0 -0
  114. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/university_6_17_no1_tx_excerpt.las +0 -0
  115. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/university_6_17_no1_tx_excerpt.provenance.json +0 -0
  116. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ursa_308_xrd_mineralogy.provenance.json +0 -0
  117. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/ursa_308_xrd_mineralogy.txt +0 -0
  118. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_15_9_19_sr_excerpt.las +0 -0
  119. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_15_9_19_sr_excerpt.provenance.json +0 -0
  120. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_15_9_19a_core_excerpt.csv +0 -0
  121. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_15_9_19a_core_excerpt.provenance.json +0 -0
  122. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_f12_f14_production_excerpt.csv +0 -0
  123. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/volve_f12_f14_production_excerpt.provenance.json +0 -0
  124. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/walvis_208_petm_carbonate.provenance.json +0 -0
  125. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/walvis_208_petm_carbonate.txt +0 -0
  126. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/woodlark_1109_rock_eval.provenance.json +0 -0
  127. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog/woodlark_1109_rock_eval.txt +0 -0
  128. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog_map.py +0 -0
  129. {gea_program-0.45.0 → gea_program-0.47.0}/gea/catalog_register.py +0 -0
  130. {gea_program-0.45.0 → gea_program-0.47.0}/gea/certificates.py +0 -0
  131. {gea_program-0.45.0 → gea_program-0.47.0}/gea/cli.py +0 -0
  132. {gea_program-0.45.0 → gea_program-0.47.0}/gea/client_reports.py +0 -0
  133. {gea_program-0.45.0 → gea_program-0.47.0}/gea/config_versioning.py +0 -0
  134. {gea_program-0.45.0 → gea_program-0.47.0}/gea/conformance.py +0 -0
  135. {gea_program-0.45.0 → gea_program-0.47.0}/gea/control_room.py +0 -0
  136. {gea_program-0.45.0 → gea_program-0.47.0}/gea/correlation.py +0 -0
  137. {gea_program-0.45.0 → gea_program-0.47.0}/gea/dashboard.py +0 -0
  138. {gea_program-0.45.0 → gea_program-0.47.0}/gea/declarations.py +0 -0
  139. {gea_program-0.45.0 → gea_program-0.47.0}/gea/deviation.py +0 -0
  140. {gea_program-0.45.0 → gea_program-0.47.0}/gea/dlis.py +0 -0
  141. {gea_program-0.45.0 → gea_program-0.47.0}/gea/dnp3.py +0 -0
  142. {gea_program-0.45.0 → gea_program-0.47.0}/gea/doctor.py +0 -0
  143. {gea_program-0.45.0 → gea_program-0.47.0}/gea/dossier.py +0 -0
  144. {gea_program-0.45.0 → gea_program-0.47.0}/gea/dossier_verify.py +0 -0
  145. {gea_program-0.45.0 → gea_program-0.47.0}/gea/downhole_engine.py +0 -0
  146. {gea_program-0.45.0 → gea_program-0.47.0}/gea/drift_monitor.py +0 -0
  147. {gea_program-0.45.0 → gea_program-0.47.0}/gea/drill_string.py +0 -0
  148. {gea_program-0.45.0 → gea_program-0.47.0}/gea/earth_model.py +0 -0
  149. {gea_program-0.45.0 → gea_program-0.47.0}/gea/economics.py +0 -0
  150. {gea_program-0.45.0 → gea_program-0.47.0}/gea/ed25519.py +0 -0
  151. {gea_program-0.45.0 → gea_program-0.47.0}/gea/edr.py +0 -0
  152. {gea_program-0.45.0 → gea_program-0.47.0}/gea/elevation.py +0 -0
  153. {gea_program-0.45.0 → gea_program-0.47.0}/gea/etp.py +0 -0
  154. {gea_program-0.45.0 → gea_program-0.47.0}/gea/etp12_schemas.json +0 -0
  155. {gea_program-0.45.0 → gea_program-0.47.0}/gea/example_register_map.json +0 -0
  156. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fat_sat.py +0 -0
  157. {gea_program-0.45.0 → gea_program-0.47.0}/gea/files.py +0 -0
  158. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fixtures/README.md +0 -0
  159. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fixtures/comcat_delaware_basin_2026-09.txt +0 -0
  160. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fixtures/comcat_mahoning_1990-2026.txt +0 -0
  161. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fixtures/comcat_youngstown_2011-2012.txt +0 -0
  162. {gea_program-0.45.0 → gea_program-0.47.0}/gea/fixtures/ne_110m_coastline.json +0 -0
  163. {gea_program-0.45.0 → gea_program-0.47.0}/gea/follower.py +0 -0
  164. {gea_program-0.45.0 → gea_program-0.47.0}/gea/forward_model.py +0 -0
  165. {gea_program-0.45.0 → gea_program-0.47.0}/gea/friction_priors.py +0 -0
  166. {gea_program-0.45.0 → gea_program-0.47.0}/gea/gamma.py +0 -0
  167. {gea_program-0.45.0 → gea_program-0.47.0}/gea/gauge_aging.py +0 -0
  168. {gea_program-0.45.0 → gea_program-0.47.0}/gea/gauge_specs.py +0 -0
  169. {gea_program-0.45.0 → gea_program-0.47.0}/gea/geodesy.py +0 -0
  170. {gea_program-0.45.0 → gea_program-0.47.0}/gea/gravity_reference.py +0 -0
  171. {gea_program-0.45.0 → gea_program-0.47.0}/gea/hartip.py +0 -0
  172. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/TESTER_GUIDE.md +0 -0
  173. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/alarms.md +0 -0
  174. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/alerts.md +0 -0
  175. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/audit-update.md +0 -0
  176. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/backup.md +0 -0
  177. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/catalog.md +0 -0
  178. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/charts.md +0 -0
  179. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/conformance.md +0 -0
  180. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/control-room.md +0 -0
  181. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/data-in.md +0 -0
  182. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/declare.md +0 -0
  183. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/dlis.md +0 -0
  184. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/doctor.md +0 -0
  185. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/dossier.md +0 -0
  186. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/drift.md +0 -0
  187. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/drillstring.md +0 -0
  188. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/economics.md +0 -0
  189. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/edr.md +0 -0
  190. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/etp.md +0 -0
  191. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/field-ports.md +0 -0
  192. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/files.md +0 -0
  193. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/historian.md +0 -0
  194. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/instruments.md +0 -0
  195. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/interval.md +0 -0
  196. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/map.md +0 -0
  197. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/month-end.md +0 -0
  198. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/notifications.md +0 -0
  199. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/opseis.md +0 -0
  200. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/osdu.md +0 -0
  201. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/pad-summary.md +0 -0
  202. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/patches.md +0 -0
  203. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/penetrator.md +0 -0
  204. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/ppdm.md +0 -0
  205. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/quakeml.md +0 -0
  206. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/quality.md +0 -0
  207. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/report-history.md +0 -0
  208. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/seedlink.md +0 -0
  209. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/seismic.md +0 -0
  210. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/setup.md +0 -0
  211. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/simulation.md +0 -0
  212. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/site.md +0 -0
  213. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/sites.md +0 -0
  214. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/slip.md +0 -0
  215. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/soak.md +0 -0
  216. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/sra.md +0 -0
  217. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/start.md +0 -0
  218. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/structure.md +0 -0
  219. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/tools.md +0 -0
  220. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/transients.md +0 -0
  221. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/upkeep.md +0 -0
  222. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/vibration.md +0 -0
  223. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/well-report.md +0 -0
  224. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/well-tests.md +0 -0
  225. {gea_program-0.45.0 → gea_program-0.47.0}/gea/help/well3d.md +0 -0
  226. {gea_program-0.45.0 → gea_program-0.47.0}/gea/housekeeping.py +0 -0
  227. {gea_program-0.45.0 → gea_program-0.47.0}/gea/interval.py +0 -0
  228. {gea_program-0.45.0 → gea_program-0.47.0}/gea/inverse_engine.py +0 -0
  229. {gea_program-0.45.0 → gea_program-0.47.0}/gea/jobs.py +0 -0
  230. {gea_program-0.45.0 → gea_program-0.47.0}/gea/live_ports.py +0 -0
  231. {gea_program-0.45.0 → gea_program-0.47.0}/gea/loadtest.py +0 -0
  232. {gea_program-0.45.0 → gea_program-0.47.0}/gea/matplotlib_demo.py +0 -0
  233. {gea_program-0.45.0 → gea_program-0.47.0}/gea/modbus.py +0 -0
  234. {gea_program-0.45.0 → gea_program-0.47.0}/gea/modbus_rtu.py +0 -0
  235. {gea_program-0.45.0 → gea_program-0.47.0}/gea/model_card.py +0 -0
  236. {gea_program-0.45.0 → gea_program-0.47.0}/gea/month_end.py +0 -0
  237. {gea_program-0.45.0 → gea_program-0.47.0}/gea/mqtt_port.py +0 -0
  238. {gea_program-0.45.0 → gea_program-0.47.0}/gea/notify.py +0 -0
  239. {gea_program-0.45.0 → gea_program-0.47.0}/gea/op_seismicity.py +0 -0
  240. {gea_program-0.45.0 → gea_program-0.47.0}/gea/opcua_port.py +0 -0
  241. {gea_program-0.45.0 → gea_program-0.47.0}/gea/operator_app.py +0 -0
  242. {gea_program-0.45.0 → gea_program-0.47.0}/gea/osdu.py +0 -0
  243. {gea_program-0.45.0 → gea_program-0.47.0}/gea/pad_summary.py +0 -0
  244. {gea_program-0.45.0 → gea_program-0.47.0}/gea/patches.py +0 -0
  245. {gea_program-0.45.0 → gea_program-0.47.0}/gea/pdf_report.py +0 -0
  246. {gea_program-0.45.0 → gea_program-0.47.0}/gea/penetrator.py +0 -0
  247. {gea_program-0.45.0 → gea_program-0.47.0}/gea/permits.py +0 -0
  248. {gea_program-0.45.0 → gea_program-0.47.0}/gea/piwebapi.py +0 -0
  249. {gea_program-0.45.0 → gea_program-0.47.0}/gea/ports.py +0 -0
  250. {gea_program-0.45.0 → gea_program-0.47.0}/gea/ppdm.py +0 -0
  251. {gea_program-0.45.0 → gea_program-0.47.0}/gea/profile_catalog.py +0 -0
  252. {gea_program-0.45.0 → gea_program-0.47.0}/gea/project.py +0 -0
  253. {gea_program-0.45.0 → gea_program-0.47.0}/gea/qt6_downhole_app.py +0 -0
  254. {gea_program-0.45.0 → gea_program-0.47.0}/gea/quakeml.py +0 -0
  255. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reconciler.py +0 -0
  256. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/IU_ANMO_10_BHZ_response.provenance.json +0 -0
  257. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/IU_ANMO_10_BHZ_response.xml +0 -0
  258. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/eia_henry_hub_daily.csv.gz +0 -0
  259. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/eia_prices.provenance.json +0 -0
  260. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/eia_wti_daily.csv.gz +0 -0
  261. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/libmseed_steim.provenance.json +0 -0
  262. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/libmseed_steim1_4096.mseed +0 -0
  263. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/libmseed_steim2_4096.mseed +0 -0
  264. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/libmseed_steim2_512.mseed +0 -0
  265. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/mahoning_example.json +0 -0
  266. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/mud_motor_specs.json +0 -0
  267. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/penetrator_ratings.json +0 -0
  268. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/seismicity_protocols.json +0 -0
  269. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/tool_sources.json +0 -0
  270. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/us_outline.json +0 -0
  271. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/us_outline.provenance.json +0 -0
  272. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_3d.provenance.json +0 -0
  273. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_f4_interpretation.las.gz +0 -0
  274. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_f4_logs.provenance.json +0 -0
  275. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_f4_lwd.las.gz +0 -0
  276. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_surfaces.json.gz +0 -0
  277. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-10.xml.gz +0 -0
  278. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-4.xml.gz +0 -0
  279. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-5_12.25in.xml.gz +0 -0
  280. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-5_17.5in.xml.gz +0 -0
  281. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-5_36in.xml.gz +0 -0
  282. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_traj_F-5_8.5in.xml.gz +0 -0
  283. {gea_program-0.45.0 → gea_program-0.47.0}/gea/reference/volve_well_picks.csv.gz +0 -0
  284. {gea_program-0.45.0 → gea_program-0.47.0}/gea/report_history.py +0 -0
  285. {gea_program-0.45.0 → gea_program-0.47.0}/gea/rock_inventory.py +0 -0
  286. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sample_record.py +0 -0
  287. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sample_well_profile.csv +0 -0
  288. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sbom.py +0 -0
  289. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seedlink.py +0 -0
  290. {gea_program-0.45.0 → gea_program-0.47.0}/gea/segy.py +0 -0
  291. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic.py +0 -0
  292. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_array.py +0 -0
  293. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_assoc.py +0 -0
  294. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_detect.py +0 -0
  295. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_film.py +0 -0
  296. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_harmonic.py +0 -0
  297. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_qc.py +0 -0
  298. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_response.py +0 -0
  299. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_signature.py +0 -0
  300. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_track.py +0 -0
  301. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_uncertainty.py +0 -0
  302. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_unlisted.py +0 -0
  303. {gea_program-0.45.0 → gea_program-0.47.0}/gea/seismic_watch.py +0 -0
  304. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sensor_swap.py +0 -0
  305. {gea_program-0.45.0 → gea_program-0.47.0}/gea/series_cache.py +0 -0
  306. {gea_program-0.45.0 → gea_program-0.47.0}/gea/service_life.py +0 -0
  307. {gea_program-0.45.0 → gea_program-0.47.0}/gea/setup_checklist.py +0 -0
  308. {gea_program-0.45.0 → gea_program-0.47.0}/gea/shapefile.py +0 -0
  309. {gea_program-0.45.0 → gea_program-0.47.0}/gea/shell.py +0 -0
  310. {gea_program-0.45.0 → gea_program-0.47.0}/gea/shut_in.py +0 -0
  311. {gea_program-0.45.0 → gea_program-0.47.0}/gea/simulation.py +0 -0
  312. {gea_program-0.45.0 → gea_program-0.47.0}/gea/site_map.py +0 -0
  313. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sla_report.py +0 -0
  314. {gea_program-0.45.0 → gea_program-0.47.0}/gea/slip.py +0 -0
  315. {gea_program-0.45.0 → gea_program-0.47.0}/gea/soak.py +0 -0
  316. {gea_program-0.45.0 → gea_program-0.47.0}/gea/sra.py +0 -0
  317. {gea_program-0.45.0 → gea_program-0.47.0}/gea/store_forward.py +0 -0
  318. {gea_program-0.45.0 → gea_program-0.47.0}/gea/strata_join.py +0 -0
  319. {gea_program-0.45.0 → gea_program-0.47.0}/gea/structure.py +0 -0
  320. {gea_program-0.45.0 → gea_program-0.47.0}/gea/supervisor.py +0 -0
  321. {gea_program-0.45.0 → gea_program-0.47.0}/gea/survey_cmd.py +0 -0
  322. {gea_program-0.45.0 → gea_program-0.47.0}/gea/survey_view.py +0 -0
  323. {gea_program-0.45.0 → gea_program-0.47.0}/gea/telemetry.py +0 -0
  324. {gea_program-0.45.0 → gea_program-0.47.0}/gea/tool_catalog.py +0 -0
  325. {gea_program-0.45.0 → gea_program-0.47.0}/gea/tool_library.py +0 -0
  326. {gea_program-0.45.0 → gea_program-0.47.0}/gea/tool_taxonomy.py +0 -0
  327. {gea_program-0.45.0 → gea_program-0.47.0}/gea/transient.py +0 -0
  328. {gea_program-0.45.0 → gea_program-0.47.0}/gea/vibration.py +0 -0
  329. {gea_program-0.45.0 → gea_program-0.47.0}/gea/well3d.py +0 -0
  330. {gea_program-0.45.0 → gea_program-0.47.0}/gea/well_assembler.py +0 -0
  331. {gea_program-0.45.0 → gea_program-0.47.0}/gea/well_report.py +0 -0
  332. {gea_program-0.45.0 → gea_program-0.47.0}/gea/well_test_validation.py +0 -0
  333. {gea_program-0.45.0 → gea_program-0.47.0}/gea/wits0.py +0 -0
  334. {gea_program-0.45.0 → gea_program-0.47.0}/gea/witsml.py +0 -0
  335. {gea_program-0.45.0 → gea_program-0.47.0}/gea/workspace.py +0 -0
  336. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/dependency_links.txt +0 -0
  337. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/entry_points.txt +0 -0
  338. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/requires.txt +0 -0
  339. {gea_program-0.45.0 → gea_program-0.47.0}/gea_program.egg-info/top_level.txt +0 -0
  340. {gea_program-0.45.0 → gea_program-0.47.0}/setup.cfg +0 -0
  341. {gea_program-0.45.0 → gea_program-0.47.0}/tests/test_acceptance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gea-program
3
- Version: 0.45.0
3
+ Version: 0.47.0
4
4
  Summary: GEA-Program: downhole gauge monitoring - canonical measurement records, quality rules, drift evaluation with a re-fit change log, well-test validation, alarm management, model cards, store-and-forward, monthly SLA measurement, FAT/SAT protocols and a dashboard, generated from live objects in the client's reporting outline.
5
5
  Author: Daniel T. Murphy
6
6
  License: MPL-2.0
@@ -648,6 +648,30 @@ against it; `gea seedlink --config ... --hello` prints what a server says of
648
648
  itself; `gea help seedlink`. A TexNet station is served by EarthScope at
649
649
  `rtserve.iris.washington.edu:18000`, network `TX`.
650
650
 
651
+ ### Rig time
652
+
653
+ What the rig did each second of the drilling record, read from the hook
654
+ load, the block, the bit, the pumps and the rotary: drilling, in the slips,
655
+ tripping, circulating, reaming, off the hook. Every drilling connection is
656
+ timed weight to weight with its three parts, every trip by its speed over
657
+ the pipe-handling hours with its breaks beside it, and the time each loses
658
+ against a target - the drilling program's, or this pad's own best quarter -
659
+ is summed per report day and priced at the contract's operating rate. The
660
+ **Rig time** tab, `gea rig-time`, `gea help rig-time`; the invoice check
661
+ shows each day's lost time beside the bill.
662
+
663
+ ### The invoice cross-check
664
+
665
+ The drilling contractor's daywork invoice, day by day, against the daily
666
+ drilling reports and the drilling record, at the contract's terms as the
667
+ operator declares them: hours billed against hours reported, standby billed
668
+ at the operating rate, rig repair past the allowance, a trip or a circulation
669
+ the recorder never saw, a depth or footage overstated, an amount that is not
670
+ quantity times price, a day billed with no report. Each day AGREES, is in
671
+ QUESTION or DIFFERS, with the dollars in question and the line each comes
672
+ from; a client report with its PDF. The **Invoice check** tab, `gea
673
+ invoice-check`, `gea help invoice-check`.
674
+
651
675
  ### The lateral, the printable reports, the daily summary and the key
652
676
 
653
677
  An earthquake near a well with a directional survey is measured from the
@@ -609,6 +609,30 @@ against it; `gea seedlink --config ... --hello` prints what a server says of
609
609
  itself; `gea help seedlink`. A TexNet station is served by EarthScope at
610
610
  `rtserve.iris.washington.edu:18000`, network `TX`.
611
611
 
612
+ ### Rig time
613
+
614
+ What the rig did each second of the drilling record, read from the hook
615
+ load, the block, the bit, the pumps and the rotary: drilling, in the slips,
616
+ tripping, circulating, reaming, off the hook. Every drilling connection is
617
+ timed weight to weight with its three parts, every trip by its speed over
618
+ the pipe-handling hours with its breaks beside it, and the time each loses
619
+ against a target - the drilling program's, or this pad's own best quarter -
620
+ is summed per report day and priced at the contract's operating rate. The
621
+ **Rig time** tab, `gea rig-time`, `gea help rig-time`; the invoice check
622
+ shows each day's lost time beside the bill.
623
+
624
+ ### The invoice cross-check
625
+
626
+ The drilling contractor's daywork invoice, day by day, against the daily
627
+ drilling reports and the drilling record, at the contract's terms as the
628
+ operator declares them: hours billed against hours reported, standby billed
629
+ at the operating rate, rig repair past the allowance, a trip or a circulation
630
+ the recorder never saw, a depth or footage overstated, an amount that is not
631
+ quantity times price, a day billed with no report. Each day AGREES, is in
632
+ QUESTION or DIFFERS, with the dollars in question and the line each comes
633
+ from; a client report with its PDF. The **Invoice check** tab, `gea
634
+ invoice-check`, `gea help invoice-check`.
635
+
612
636
  ### The lateral, the printable reports, the daily summary and the key
613
637
 
614
638
  An earthquake near a well with a directional survey is measured from the
@@ -123,7 +123,7 @@ from .profile_catalog import (
123
123
  read_pangaea_txt,
124
124
  )
125
125
 
126
- __version__ = "0.45.0"
126
+ __version__ = "0.47.0"
127
127
  __all__ = [
128
128
  "aging_rate", "rate_psi_yr", "accuracy_psi",
129
129
  "Sensor", "SimulatorConfig", "DownholeEngine",
@@ -590,6 +590,36 @@ def main(argv=None) -> int:
590
590
  p_dz.add_argument("--actor", type=str, default="cli")
591
591
  p_dz.add_argument("--json", action="store_true")
592
592
 
593
+ p_rt = sub.add_parser("rig-time", help="what the rig did each second of the drilling record - drilling, connections, trips, the slips - and the time lost against the pad's own best")
594
+ p_rt.add_argument("--workspace", type=str, required=True)
595
+ p_rt.add_argument("--well", type=str, default=None, help="with --write: one well's report (without it, the pad's)")
596
+ p_rt.add_argument("--write", action="store_true", help="write the client report")
597
+ p_rt.add_argument("--w2w-min", type=str, default=None, help="declare the weight-to-weight connection target, minutes ('' removes it)")
598
+ p_rt.add_argument("--trip-in", type=str, default=None, help="declare the tripping-in target, ft/h")
599
+ p_rt.add_argument("--trip-out", type=str, default=None, help="declare the tripping-out target, ft/h")
600
+ p_rt.add_argument("--source", type=str, default="", help="where the targets came from")
601
+ p_rt.add_argument("--block-weight", type=str, default=None, help="with --well: the block weight in klbf where the estimate is wrong ('' removes it)")
602
+ p_rt.add_argument("--actor", type=str, default="cli")
603
+ p_rt.add_argument("--json", action="store_true")
604
+
605
+ p_iv = sub.add_parser("invoice-check", help="the drilling contractor's daywork invoice, day by day, against the daily drilling reports and the drilling record, at the contract's terms")
606
+ p_iv.add_argument("--workspace", type=str, default=None)
607
+ p_iv.add_argument("--well", type=str, default=None)
608
+ p_iv.add_argument("--template", type=str, default=None, choices=["ddr", "invoice"], help="print the headings a file needs")
609
+ p_iv.add_argument("--attach-ddr", type=str, default=None, help="a daily drilling report (CSV)")
610
+ p_iv.add_argument("--attach-invoice", type=str, default=None, help="an invoice (CSV)")
611
+ p_iv.add_argument("--source", type=str, default="", help="with --attach-*: where the file came from")
612
+ p_iv.add_argument("--terms-source", type=str, default=None, help="declare the contract's terms: where they came from")
613
+ p_iv.add_argument("--day-start", type=str, default="06:00")
614
+ p_iv.add_argument("--report-date", type=str, default="start", choices=["start", "end"])
615
+ for k_ in ("operating", "standby", "repair", "moving", "force-majeure"):
616
+ p_iv.add_argument(f"--{k_}", type=float, default=None, help=f"the {k_.replace('-', ' ')} day rate, USD")
617
+ p_iv.add_argument("--repair-hours-job", type=float, default=None)
618
+ p_iv.add_argument("--repair-hours-month", type=float, default=None)
619
+ p_iv.add_argument("--write", action="store_true", help="write the client report")
620
+ p_iv.add_argument("--actor", type=str, default="cli")
621
+ p_iv.add_argument("--json", action="store_true")
622
+
593
623
  p_ps = sub.add_parser("pad-summary", help="the daily pad summary: what changed since the last one, what is due, what is still missing - one page, kept in report history; the service writes it each day and sends it through the notification rules")
594
624
  p_ps.add_argument("--workspace", type=str, required=True)
595
625
  p_ps.add_argument("--send", action="store_true", help="also hand it to the notification rules (the event pad.summary)")
@@ -2338,6 +2368,72 @@ def main(argv=None) -> int:
2338
2368
  print(f" {os.path.join(ws.reports_dir, e['path'])}")
2339
2369
  print(f" key fingerprint {e['fingerprint']}")
2340
2370
  return 0
2371
+ elif a.cmd == "rig-time":
2372
+ import json as _json
2373
+ from . import rig_state as _RS
2374
+ from .cli import _safe_stdout
2375
+ from .workspace import Workspace, WorkspaceError
2376
+ _safe_stdout()
2377
+ try:
2378
+ ws = Workspace(a.workspace)
2379
+ if a.w2w_min is not None or a.trip_in is not None or a.trip_out is not None or a.block_weight is not None:
2380
+ if a.block_weight is not None and not a.well:
2381
+ raise ValueError("--block-weight needs --well")
2382
+ s_ = _RS.set_settings(ws, a.actor, a.source, a.w2w_min, a.trip_in, a.trip_out, (a.well, a.block_weight) if a.block_weight is not None else None)
2383
+ print("targets: " + (", ".join(f"{k} {v:g}" for k, v in s_.get("targets", {}).items()) or "none declared")
2384
+ + "; block weights: " + (", ".join(f"{k} {v:g} klbf" for k, v in s_.get("block_weight_klbf", {}).items()) or "estimated"))
2385
+ return 0
2386
+ if a.write:
2387
+ r_ = _RS.write_report(ws, __version__, a.actor, a.well)
2388
+ print(f"wrote {r_['report_id']}: {r_['paths']['html']}")
2389
+ if r_['paths'].get('pdf'):
2390
+ print(f" printable: {r_['paths']['pdf']}")
2391
+ return 0
2392
+ p_ = _RS.pad(ws)
2393
+ except (KeyError, ValueError, OSError, WorkspaceError) as e:
2394
+ raise SystemExit(f"rig-time: {e.args[0] if e.args else e}")
2395
+ print(_json.dumps(p_, default=str) if a.json else _RS.text(p_))
2396
+ return 0
2397
+ elif a.cmd == "invoice-check":
2398
+ import json as _json
2399
+ from . import invoice_check as _IC
2400
+ from .cli import _safe_stdout
2401
+ from .workspace import Workspace, WorkspaceError
2402
+ _safe_stdout()
2403
+ if a.template:
2404
+ print(_IC.template(a.template), end="")
2405
+ return 0
2406
+ if not a.workspace:
2407
+ raise SystemExit("invoice-check: give --workspace C:\\site (or --template ddr)")
2408
+ try:
2409
+ ws = Workspace(a.workspace)
2410
+ if a.terms_source is not None:
2411
+ t_ = _IC.set_terms(ws, a.actor, a.terms_source, a.day_start, a.report_date,
2412
+ {"operating": a.operating, "standby": a.standby, "repair": a.repair, "moving": a.moving, "force_majeure": a.force_majeure},
2413
+ a.repair_hours_job, a.repair_hours_month)
2414
+ print("terms kept: " + ", ".join(f"{k} {v:,.2f} USD/day" for k, v in t_["rates_usd_per_day"].items()) + f"; report day from {t_['day_start']}")
2415
+ return 0
2416
+ wid = a.well or (ws.wells()[0]["id"] if ws.wells() else None)
2417
+ if wid is None:
2418
+ raise SystemExit("invoice-check: the workspace has no wells")
2419
+ for kind, f_ in (("ddr", a.attach_ddr), ("invoice", a.attach_invoice)):
2420
+ if f_:
2421
+ with open(f_, "rb") as fh:
2422
+ r_ = _IC.attach(ws, a.actor, wid, kind, os.path.basename(f_), fh.read(), a.source)
2423
+ print(f"attached {r_['name']}: {r_['lines']} line(s)" + (f", {len(r_['errors'])} not read" if r_['errors'] else ""))
2424
+ if a.attach_ddr or a.attach_invoice:
2425
+ return 0
2426
+ if a.write:
2427
+ r_ = _IC.write_report(ws, wid, __version__, a.actor)
2428
+ print(f"wrote {r_['report_id']} ({r_['status']}): {r_['paths']['html']}")
2429
+ if r_['paths'].get('pdf'):
2430
+ print(f" printable: {r_['paths']['pdf']}")
2431
+ return 0
2432
+ r = _IC.check(ws, wid)
2433
+ except (KeyError, ValueError, OSError, WorkspaceError) as e:
2434
+ raise SystemExit(f"invoice-check: {e.args[0] if e.args else e}")
2435
+ print(_json.dumps(r, default=str) if a.json else _IC.text(r))
2436
+ return 0
2341
2437
  elif a.cmd == "pad-summary":
2342
2438
  import json as _json
2343
2439
  from . import pad_summary as _PS
@@ -10610,6 +10610,309 @@ def section_cn_four(tmp: str) -> None:
10610
10610
  + (f" [failed: {', '.join(failed5)}]" if failed5 else ""))
10611
10611
 
10612
10612
 
10613
+ def section_co_invoice_check(tmp: str) -> None:
10614
+ """Section CO - the invoice cross-check: the daily drilling report and the invoice read by their headings in
10615
+ whatever order and spelling a form uses, a file that is neither refused with the headings it needs; a labelled
10616
+ scene of five report days with seven planted differences - a day billed twice, repair past the allowance at the
10617
+ operating rate, a trip the record shows never happened, standby billed at the operating rate, a depth and footage
10618
+ overstated, an amount that is not quantity times price, a day billed with no report and nothing on the record -
10619
+ each found with the dollars it puts in question; the same days billed and reported correctly agree; the report
10620
+ with its PDF; the API, the CLI, the tab and the help page."""
10621
+ import http.cookiejar
10622
+ import subprocess as _sp
10623
+ import urllib.request
10624
+ import urllib.error
10625
+ import base64 as _b64
10626
+ from . import __version__
10627
+ from . import client_reports as CR
10628
+ from . import helplib as H
10629
+ from . import invoice_check as IC
10630
+ from . import pdf_report as PDF
10631
+ from .workspace import Workspace
10632
+ from .service import Service, Users
10633
+ pkg = Path(__file__).parent
10634
+ d = Path(tmp, "co"); d.mkdir()
10635
+
10636
+ # -- CO1 reading the files ---------------------------------------------------------------------------------------
10637
+ t_ddr, t_inv = IC.read_ddr(IC.template("ddr")), IC.read_invoice(IC.template("invoice"))
10638
+ odd = IC.read_ddr("Rpt Date;Start Time;End Time;IADC Code;Operations;MD From;MD To\n07/01/2026;0600;1800;2 - Drilling;Drill ahead;9500;10,100\n"
10639
+ "07/01/2026;1800;0600;33;Standby - waiting on orders;10100;10100\nnot a date;0600;0700;2;x;1;2\n")
10640
+ span = IC.read_invoice("Period From,Period To,Charge,Qty,UOM,Rate,Ext Amount\n2026-07-01,2026-07-03,Stand-by rate,3,day,25000,75000\n"
10641
+ "2026-07-04,2026-07-04,Mobilization,1,lot,50000,50000\n")
10642
+ try:
10643
+ IC.read_ddr("Name,Value\na,1\n")
10644
+ refused = ""
10645
+ except ValueError as e:
10646
+ refused = str(e)
10647
+ c1 = {
10648
+ "templates": len(t_ddr["lines"]) == 2 and t_ddr["lines"][0]["code"] == 2 and t_ddr["lines"][1]["hours"] == 12 and len(t_inv["lines"]) == 2
10649
+ and t_inv["lines"][1]["kind"] == "standby" and t_inv["lines"][1]["hours"] == 12,
10650
+ "odd": len(odd["lines"]) == 2 and odd["lines"][0]["date"] == "2026-07-01" and odd["lines"][0]["hours"] == 12 and odd["lines"][1]["hours"] == 12
10651
+ and odd["lines"][0]["depth_to_ft"] == 10100 and odd["lines"][1]["standby"] and len(odd["errors"]) == 1 and "row 4" in odd["errors"][0],
10652
+ "span": span["lines"][0]["kind"] == "standby" and span["lines"][0]["price"] == 25000 and span["lines"][0]["to"] == "2026-07-03" and span["lines"][0]["hours"] == 72
10653
+ and span["lines"][1]["kind"] == "moving",
10654
+ "refused": "Date column" in refused and "--template ddr" in refused,
10655
+ }
10656
+ failed1 = [k for k, v in c1.items() if not v]
10657
+ ok(not failed1,
10658
+ "CO1 the files read by their headings: the templates; a semicolon report with its own headings, times without colons, a code with its "
10659
+ "name, a standby line, a row that does not read named and the rest kept; an invoice span of days at a 'Rate' that is a price; a file "
10660
+ "that is neither refused with the headings it needs" + (f" [failed: {', '.join(failed1)}]" if failed1 else ""))
10661
+
10662
+ # -- CO2 the cross-check ---------------------------------------------------------------------------------------------
10663
+ F = IC.selftest_files(str(d))
10664
+ wsp = str(d / "ws"); ws = Workspace.create(wsp, "Pad CO", actor="tester")
10665
+ w = ws.add_well_file(F["edr"], display="INV-1", actor="tester")
10666
+ r_none = IC.check(ws, w["id"])
10667
+ IC.set_terms(ws, "tester", "test daywork contract, Exhibit A", "06:00", "start", {"operating": 30000, "standby": 25000, "repair": 0}, None, 2)
10668
+ r_nofiles = IC.check(ws, w["id"])
10669
+ IC.attach(ws, "tester", w["id"], "ddr", "ddr.csv", F["ddr"].encode(), "test reports")
10670
+ IC.attach(ws, "tester", w["id"], "invoice", "inv.csv", F["invoice"].encode(), "test invoice 1")
10671
+ r = IC.check(ws, w["id"])
10672
+ D = {x["date"]: x for x in r["days"]}
10673
+ fd = lambda dk: {f["check"]: f for f in D[dk]["findings"]}
10674
+ c2 = {
10675
+ "states": r_none["status"] == "NO TERMS" and r_nofiles["status"] == "NO FILES" and r["status"] == "DIFFERS"
10676
+ and [D[k]["status"] for k in sorted(D)] == ["DIFFERS", "DIFFERS", "DIFFERS", "DIFFERS", "QUESTION"],
10677
+ "day1": set(fd("2026-07-01")) == {"OVER 24 H", "BILLED TWICE"} and fd("2026-07-01")["OVER 24 H"]["usd_in_question"] == 30000
10678
+ and abs(D["2026-07-01"]["record"]["drilling_h"] - 18) < 0.2 and D["2026-07-01"]["record"]["quiet_h"] < 0.2,
10679
+ "day2": fd("2026-07-02")["REPAIR OVER ALLOWANCE"]["usd_in_question"] == 2500 and "14:00-16:00" in fd("2026-07-02")["LINE VS RECORD"]["detail"]
10680
+ and fd("2026-07-02")["LINE VS RECORD"]["ref"] == "ddr.csv row 6" and "DRILLING HOURS" not in fd("2026-07-02"),
10681
+ "day3": abs(fd("2026-07-03")["STANDBY AT OPERATING"]["usd_in_question"] - 4166.67) < 0.01 and fd("2026-07-03")["QUIET ON THE RECORD"]["severity"] == "QUESTION",
10682
+ "day4": fd("2026-07-04")["ARITHMETIC"]["usd_in_question"] == 1000 and "7,600" in fd("2026-07-04")["DEPTH"]["detail"] and "1,200" in fd("2026-07-04")["FOOTAGE"]["detail"],
10683
+ "day5": set(fd("2026-07-05")) == {"NO REPORT", "NOT IN THE RECORD"},
10684
+ "totals": r["totals"]["usd_in_question"] == 37666.67 and r["totals"]["billed_checked_usd"] == 181000 and r["totals"]["billed_usd"] == 185200
10685
+ and [x["description"] for x in r["other_lines"]] == ["Fuel (diesel)"] and set(r["record"]["channels"]) == {"drilling flag", "pump output", "rotary", "bit depth"},
10686
+ }
10687
+ # the same days billed and reported as they happened
10688
+ ws2 = Workspace.create(str(d / "ws2"), "Pad CO2", actor="tester")
10689
+ w2 = ws2.add_well_file(F["edr"], display="INV-2", actor="tester")
10690
+ IC.set_terms(ws2, "tester", "test daywork contract", "06:00", "start", {"operating": 30000, "standby": 25000, "repair": 0}, None, 2)
10691
+ ddr_ok = F["ddr"].replace("2026-07-02,14:00,16:00,2,6,Trip out", "2026-07-02,14:00,16:00,2,7,Service rig").replace("6200,7600", "6200,7400")
10692
+ inv_ok = ("Date,Rate Type,Quantity,Unit,Unit Price,Amount\n2026-07-01,Operating day rate,1,day,30000,30000\n"
10693
+ "2026-07-02,Operating day rate,22,hour,1250,27500\n2026-07-02,Repair rate,2,hour,0,0\n"
10694
+ "2026-07-03,Standby rate,20,hour,1041.6667,20833.33\n2026-07-03,Operating day rate,4,hour,1250,5000\n2026-07-04,Operating day rate,1,day,30000,30000\n")
10695
+ IC.attach(ws2, "tester", w2["id"], "ddr", "ddr.csv", ddr_ok.encode(), "test reports")
10696
+ IC.attach(ws2, "tester", w2["id"], "invoice", "inv.csv", inv_ok.encode(), "test invoice 2")
10697
+ r2 = IC.check(ws2, w2["id"])
10698
+ c2["clean"] = r2["status"] == "AGREES" and r2["totals"]["agrees"] == 4 and r2["totals"]["usd_in_question"] == 0 and r2["findings"] == []
10699
+ failed2 = [k for k, v in c2.items() if not v]
10700
+ ok(not failed2,
10701
+ "CO2 the cross-check: no terms, then no files, said so; five report days against the record - a day billed twice, 2 h of repair past "
10702
+ "a 2 h allowance at the operating rate (2,500.00), a trip the record shows never moved, 20 h of standby billed at the operating rate "
10703
+ "(4,166.67) with the quiet hours a question, an overstated depth and footage, an amount 1,000.00 over quantity times price, a day "
10704
+ "billed with no report and nothing on the record; 37,666.67 in question; the fuel listed, not checked; the same days billed and "
10705
+ "reported as they happened agree, the standby hours explaining the quiet" + (f" [failed: {', '.join(failed2)}]" if failed2 else ""))
10706
+
10707
+ # -- CO3 the report, the API, the CLI, the tab, the help -----------------------------------------------------------
10708
+ rep = IC.write_report(ws, w["id"], __version__, "tester")
10709
+ rd = PDF.read(Path(rep["paths"]["pdf"]).read_bytes())
10710
+ html_ = Path(rep["paths"]["html"]).read_text(encoding="utf-8")
10711
+ Users(str(Path(wsp, "users.json"))).add("v", "viewer-pass-1", "viewer"); Users(str(Path(wsp, "users.json"))).add("op", "op-pass-123", "operator")
10712
+ svc = Service(wsp, port=0, scheduler=False).start()
10713
+ base_url = svc.url.rstrip("/")
10714
+
10715
+ def opener(name, pw_):
10716
+ o = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(http.cookiejar.CookieJar()))
10717
+ rq = urllib.request.Request(base_url + "/api/login", method="POST", data=json.dumps({"name": name, "password": pw_}).encode())
10718
+ rq.add_header("Content-Type", "application/json"); rq.add_header("X-GEA-Action", "1"); o.open(rq, timeout=30)
10719
+ return o
10720
+
10721
+ def call(o, method, path, body=None):
10722
+ rq = urllib.request.Request(base_url + path, method=method, data=(json.dumps(body).encode() if body is not None else None))
10723
+ if method == "POST":
10724
+ rq.add_header("Content-Type", "application/json"); rq.add_header("X-GEA-Action", "1")
10725
+ try:
10726
+ with o.open(rq, timeout=120) as rr_:
10727
+ return rr_.status, json.loads(rr_.read())
10728
+ except urllib.error.HTTPError as e:
10729
+ return e.code, json.loads(e.read())
10730
+ try:
10731
+ V, O = opener("v", "viewer-pass-1"), opener("op", "op-pass-123")
10732
+ s_g, gj = call(V, "GET", "/api/invoice-check?well=" + w["id"])
10733
+ s_bad, _ = call(V, "GET", "/api/invoice-check?well=nope")
10734
+ s_vt, _ = call(V, "POST", "/api/invoice-check/terms", {"source": "x", "operating": 1})
10735
+ s_ot, otj = call(O, "POST", "/api/invoice-check/terms", {"source": "contract B", "day_start": "06:00", "operating": 30000, "standby": 25000, "repair": 0, "repair_hours_per_month": 2})
10736
+ s_ob, _ = call(O, "POST", "/api/invoice-check/terms", {"source": "contract B", "day_start": "6am", "operating": 30000})
10737
+ s_oa, oaj = call(O, "POST", "/api/invoice-check/attach", {"well_id": w["id"], "kind": "invoice", "filename": "inv2.csv", "source": "invoice 2",
10738
+ "content_b64": _b64.b64encode(IC.template("invoice").encode()).decode()})
10739
+ s_ow, owj = call(O, "POST", "/api/invoice-check/write", {"well_id": w["id"]})
10740
+ s_or, _ = call(O, "POST", "/api/invoice-check/remove", {"file": oaj.get("file", "")})
10741
+ finally:
10742
+ svc.stop()
10743
+ cli_t = _sp.run([sys.executable, "-m", "gea", "invoice-check", "--template", "invoice"], capture_output=True, text=True, cwd=str(pkg.parent))
10744
+ cli_c = _sp.run([sys.executable, "-m", "gea", "invoice-check", "--workspace", wsp, "--well", w["id"]], capture_output=True, text=True, cwd=str(pkg.parent))
10745
+ cli_w = _sp.run([sys.executable, "-m", "gea", "invoice-check", "--workspace", wsp, "--well", w["id"], "--write"], capture_output=True, text=True, cwd=str(pkg.parent))
10746
+ page_src = (pkg / "web" / "app.html").read_text(encoding="utf-8")
10747
+ c3 = {
10748
+ "report": rd["ok"] and rep["status"] == "DIFFERS" and "Invoice cross-check - INV-1" in rd["text"][0] and "37,666.67" in html_ and "REPAIR OVER ALLOWANCE" in html_
10749
+ and not CR.forbidden_terms(html_),
10750
+ "api": s_g == 200 and gj["check"]["totals"]["usd_in_question"] == 37666.67 and s_bad == 404 and s_vt == 403 and s_ot == 200 and otj["source"] == "contract B"
10751
+ and s_ob == 400 and s_oa == 200 and oaj["lines"] == 2 and s_ow == 200 and owj["report_id"].startswith("INV-") and s_or == 200,
10752
+ "cli": cli_t.returncode == 0 and "Rate Type" in cli_t.stdout and cli_c.returncode == 0 and "REPAIR OVER ALLOWANCE" in cli_c.stdout and "37,666.67" in cli_c.stdout
10753
+ and cli_w.returncode == 0 and "printable:" in cli_w.stdout,
10754
+ "page": all(x in page_src for x in ("VIEWS.invoices", "['#/invoices', 'Invoice check']", "/api/invoice-check/attach", "ivTerms")),
10755
+ "help": any(t[0] == "invoice-check" for t in H.INDEX) and not H.check("invoice-check") and H.VIEW_TOPIC.get("invoices") == "invoice-check",
10756
+ }
10757
+ failed3 = [k for k, v in c3.items() if not v]
10758
+ ok(not failed3,
10759
+ "CO3 the report (with its PDF) and the check on the API (anyone signed in reads it; only an operator declares terms, attaches, "
10760
+ "removes or writes; a start hour that is not one refused), the CLI (a template, the check, the report written), the tab and the help page"
10761
+ + (f" [failed: {', '.join(failed3)}]" if failed3 else ""))
10762
+
10763
+
10764
+ def section_cp_rig_time(tmp: str) -> None:
10765
+ """Section CP - rig time: a recorder export with known answers - three drilling connections of 6, 9 and 15 minutes
10766
+ weight to weight, a 3,000 ft trip out at 2,449 ft/h and in at 3,333 ft/h over their pipe-handling hours, the block's
10767
+ 40 klbf - read back to the second; the slips not taken from a light string pushed into a lateral, a depth re-set
10768
+ not taken for pipe moving, the weight off the hook for half an hour not a connection, the slips found from the block
10769
+ when there is no hook load; the targets as the pad's best quarter or as declared, each connection's and trip's time
10770
+ past them, priced at the contract's operating rate and beside each day of the invoice check; the report with its
10771
+ PDF; the API, the CLI, the tab and the help page."""
10772
+ import http.cookiejar
10773
+ import subprocess as _sp
10774
+ import urllib.request
10775
+ import urllib.error
10776
+ from datetime import datetime as _dtm
10777
+ from . import __version__
10778
+ from . import helplib as H
10779
+ from . import invoice_check as IC
10780
+ from . import pdf_report as PDF
10781
+ from . import rig_state as RS
10782
+ from .workspace import Workspace
10783
+ from .service import Service, Users
10784
+ pkg = Path(__file__).parent
10785
+ d = Path(tmp, "cp"); d.mkdir()
10786
+ F = RS.selftest_edr(str(d))
10787
+ E_ = F["expect"]
10788
+ wsp = str(d / "ws"); ws = Workspace.create(wsp, "Pad CP", actor="tester")
10789
+ w1 = ws.add_well_file(F["path"], display="RIG-1", actor="tester")
10790
+ r = RS.well(ws, w1["id"])
10791
+
10792
+ # -- CP1 the states, the connections, the trips ------------------------------------------------------------------
10793
+ cs = r["connections"]
10794
+ tr = {x["direction"]: x for x in r["trips"]}
10795
+ near = lambda a, b, tol: a is not None and abs(a - b) <= tol
10796
+ t = np.arange(0.0, 7200.0)
10797
+ n = len(t)
10798
+ zeros = np.zeros(n)
10799
+ lateral = RS.classify(t, {"hookload": np.full(n, 45.0), "block": 100.0 - t * 0.01, "bit": 15000.0 + t * 1.0, "hole": np.full(n, 25000.0),
10800
+ "flow": zeros, "spp": None, "rpm": zeros}, np.zeros(n, bool), block_weight=40.0)
10801
+ jump_bit = np.where(t < 3600, 9000.0, 9600.0)
10802
+ jump = RS.classify(t, {"hookload": np.full(n, 200.0), "block": np.full(n, 50.0), "bit": jump_bit, "hole": np.full(n, 9700.0), "flow": zeros,
10803
+ "spp": None, "rpm": zeros}, np.zeros(n, bool), block_weight=40.0)
10804
+ hang = RS.classify(t, {"hookload": np.full(n, 40.0), "block": np.full(n, 50.0), "bit": np.full(n, 9000.0), "hole": np.full(n, 9700.0), "flow": zeros,
10805
+ "spp": None, "rpm": zeros}, np.zeros(n, bool), block_weight=40.0)
10806
+ blk = 10.0 + (t % 120.0)
10807
+ nohl = RS.classify(t, {"hookload": None, "block": blk, "bit": np.full(n, 9000.0), "hole": np.full(n, 9700.0), "flow": zeros, "spp": None, "rpm": zeros},
10808
+ np.zeros(n, bool))
10809
+ c1 = {
10810
+ "connections": [round(c["w2w_min"]) for c in cs] == [6, 9, 15] and all(near(c["w2w_min"], e, 0.1) for c, e in zip(cs, E_["connections_w2w_min"]))
10811
+ and all(near(c["slips_min"], e, 0.1) for c, e in zip(cs, E_["slips_min"])) and all(near(c["pre_min"], 1.0, 0.1) and near(c["post_min"], 1.0, 0.1) for c in cs),
10812
+ "trips": set(tr) == {"IN", "OUT"} and near(tr["OUT"]["speed_ft_h"], E_["trip_out_ft_h"], 0.02 * E_["trip_out_ft_h"])
10813
+ and near(tr["IN"]["speed_ft_h"], E_["trip_in_ft_h"], 0.02 * E_["trip_in_ft_h"]) and near(tr["OUT"]["feet"], 3000, 30) and tr["OUT"]["connections"] >= 29
10814
+ and near(tr["OUT"]["moving_speed_ft_h"], 6000, 600),
10815
+ "states": near(r["hours"]["ROTARY DRILLING"], 2.0, 0.02) and r["hours"]["SLIDE DRILLING"] == 0 and r["hours"]["OFF THE HOOK"] == 0
10816
+ and near(r["footage"]["rotary_ft"], 380, 2) and near(r["footage"]["rotary_rop_ft_h"], 190, 2),
10817
+ "block": near(r["block_weight_klbf"], E_["block_weight_klbf"], 0.01) and r["block_weight_estimated"] and near(r["slips_threshold_klbf"], 60.0, 0.01),
10818
+ "lateral": int((lateral["state"] == RS.SLIPS).sum()) == 0 and int((lateral["state"] == RS.TIN).sum()) > 0.9 * n,
10819
+ "jump": int((jump["state"] == RS.TIN).sum()) == 0,
10820
+ "off_hook": int((hang["state"] == RS.OFFHOOK).sum()) == n and int((hang["state"] == RS.SLIPS).sum()) == 0,
10821
+ "no_hookload": nohl["slips"].sum() > 0.5 * n and "no hook load" in nohl["how"][0],
10822
+ }
10823
+ failed1 = [k for k, v in c1.items() if not v]
10824
+ ok(not failed1,
10825
+ "CP1 the record read to the second: three connections of 6, 9 and 15 min weight to weight with 4, 7 and 13 min in the slips; a 3,000 ft "
10826
+ "trip out at 2,449 ft/h and in at 3,333 ft/h over their pipe-handling hours; 2.0 h drilling 380 ft; the block's 40 klbf estimated; a light "
10827
+ "string pushed into a lateral tripping, not in the slips; a depth re-set not pipe moving; the weight off the hook for two hours OFF THE "
10828
+ "HOOK; the slips from the block when there is no hook load" + (f" [failed: {', '.join(failed1)}]" if failed1 else ""))
10829
+
10830
+ # -- CP2 the targets and the time lost ----------------------------------------------------------------------------
10831
+ w2 = ws.add_well_file(F["path"], display="RIG-2", actor="tester")
10832
+ p0 = RS.pad(ws)
10833
+ tg0 = p0["targets"]
10834
+ w2w = sorted(c["w2w_min"] for w_ in p0["wells"] for c in w_["connection_list"])
10835
+ lost0 = sum(max(0.0, x - tg0["w2w_min"]["value"]) for x in w2w) / 60.0
10836
+ IC.set_terms(ws, "tester", "test contract", "06:00", "start", {"operating": 30000}, None, None)
10837
+ try:
10838
+ RS.set_settings(ws, "tester", "", 5)
10839
+ no_source = False
10840
+ except ValueError:
10841
+ no_source = True
10842
+ RS.set_settings(ws, "tester", "drilling program 2026", 5, 2800, None)
10843
+ p1 = RS.pad(ws)
10844
+ W1 = p1["wells"][0]
10845
+ ti = next(x for x in W1["trips"] if x["direction"] == "IN")
10846
+ IC.attach(ws, "tester", w1["id"], "invoice", "inv.csv", b"Date,Rate Type,Quantity,Unit,Unit Price,Amount\n2026-08-01,Operating day rate,1,day,30000,30000\n", "test")
10847
+ ic = IC.check(ws, w1["id"])
10848
+ c2 = {
10849
+ "best_quarter": tg0["w2w_min"]["value"] == round(float(np.percentile(w2w, 25)), 2) and "best quarter" in tg0["w2w_min"]["how"] and tg0["trip_in_ft_h"] is None
10850
+ and abs(sum(w_["lost_connections_h"] for w_ in p0["wells"]) - lost0) < 0.02,
10851
+ "declared": no_source and p1["targets"]["w2w_min"]["value"] == 5 and "drilling program 2026" in p1["targets"]["w2w_min"]["how"]
10852
+ and abs(W1["lost_connections_h"] - sum(c["w2w_min"] - 5 for c in W1["connection_list"]) / 60.0) < 0.01
10853
+ and abs(ti["lost_h"] - max(0.0, ti["hours"] - ti["feet"] / 2800.0)) < 0.001 and next(x for x in W1["trips"] if x["direction"] == "OUT")["lost_h"] is None,
10854
+ "priced": p1["operating_usd_per_day"] == 30000 and abs(W1["lost_usd"] - W1["lost_h"] / 24.0 * 30000) < 0.006 * 30000 / 24.0,
10855
+ "by_day": len(W1["days"]) == 1 and W1["days"][0]["date"] == "2026-08-01" and W1["days"][0]["connections"] == 3 and abs(W1["days"][0]["lost_h"] - W1["lost_h"]) < 0.02,
10856
+ "invoice": ic["days"][0]["lost_time"] and abs(ic["days"][0]["lost_time"]["lost_h"] - W1["lost_h"]) < 0.02 and ic["days"][0]["status"] == "QUESTION",
10857
+ }
10858
+ failed2 = [k for k, v in c2.items() if not v]
10859
+ ok(not failed2,
10860
+ "CP2 the targets: the pad's best quarter (the 25th percentile of its connections) when none is declared, a declared target needing its "
10861
+ "source and then used; each connection's and trip's time past its target summed per well and per report day, priced at the contract's "
10862
+ "operating rate, and shown beside the invoice check's day" + (f" [failed: {', '.join(failed2)}]" if failed2 else ""))
10863
+
10864
+ # -- CP3 the report, the API, the CLI, the tab, the help ------------------------------------------------------------
10865
+ rp = RS.write_report(ws, __version__, "tester")
10866
+ rw = RS.write_report(ws, __version__, "tester", w1["id"])
10867
+ rd = PDF.read(Path(rp["paths"]["pdf"]).read_bytes())
10868
+ Users(str(Path(wsp, "users.json"))).add("v", "viewer-pass-1", "viewer"); Users(str(Path(wsp, "users.json"))).add("op", "op-pass-123", "operator")
10869
+ svc = Service(wsp, port=0, scheduler=False).start()
10870
+ base_url = svc.url.rstrip("/")
10871
+
10872
+ def opener(name, pw_):
10873
+ o = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(http.cookiejar.CookieJar()))
10874
+ rq = urllib.request.Request(base_url + "/api/login", method="POST", data=json.dumps({"name": name, "password": pw_}).encode())
10875
+ rq.add_header("Content-Type", "application/json"); rq.add_header("X-GEA-Action", "1"); o.open(rq, timeout=30)
10876
+ return o
10877
+
10878
+ def call(o, method, path, body=None):
10879
+ rq = urllib.request.Request(base_url + path, method=method, data=(json.dumps(body).encode() if body is not None else None))
10880
+ if method == "POST":
10881
+ rq.add_header("Content-Type", "application/json"); rq.add_header("X-GEA-Action", "1")
10882
+ try:
10883
+ with o.open(rq, timeout=120) as rr_:
10884
+ return rr_.status, json.loads(rr_.read())
10885
+ except urllib.error.HTTPError as e:
10886
+ return e.code, json.loads(e.read())
10887
+ try:
10888
+ V, O = opener("v", "viewer-pass-1"), opener("op", "op-pass-123")
10889
+ s_g, gj = call(V, "GET", "/api/rig-time")
10890
+ s_vs, _ = call(V, "POST", "/api/rig-time/settings", {"w2w_min": 4, "source": "x"})
10891
+ s_os, osj = call(O, "POST", "/api/rig-time/settings", {"w2w_min": 4.5, "source": "program B"})
10892
+ s_bad, _ = call(O, "POST", "/api/rig-time/settings", {"w2w_min": -1, "source": "program B"})
10893
+ s_bw, bwj = call(O, "POST", "/api/rig-time/settings", {"well_id": w2["id"], "block_weight_klbf": 42})
10894
+ s_w, wj = call(O, "POST", "/api/rig-time/write", {"well_id": w2["id"]})
10895
+ finally:
10896
+ svc.stop()
10897
+ cli_t = _sp.run([sys.executable, "-m", "gea", "rig-time", "--workspace", wsp], capture_output=True, text=True, cwd=str(pkg.parent))
10898
+ cli_w = _sp.run([sys.executable, "-m", "gea", "rig-time", "--workspace", wsp, "--write"], capture_output=True, text=True, cwd=str(pkg.parent))
10899
+ page_src = (pkg / "web" / "app.html").read_text(encoding="utf-8")
10900
+ c3 = {
10901
+ "report": rd["ok"] and "Rig time - Pad CP" in rd["text"][0] and Path(rw["paths"]["pdf"]).is_file() and "weight to weight" in Path(rp["paths"]["html"]).read_text(encoding="utf-8").lower(),
10902
+ "api": s_g == 200 and len(gj["wells"]) == 2 and gj["targets"]["w2w_min"]["value"] == 5 and s_vs == 403 and s_os == 200 and osj["targets"]["w2w_min"] == 4.5
10903
+ and s_bad == 400 and s_bw == 200 and bwj["block_weight_klbf"][w2["id"]] == 42 and s_w == 200 and wj["report_id"].startswith("RIG-"),
10904
+ "cli": cli_t.returncode == 0 and "drilling connections: weight to weight median 9.0 min" in cli_t.stdout and "the block weight declared, 42 klbf" in cli_t.stdout
10905
+ and cli_w.returncode == 0 and "printable:" in cli_w.stdout,
10906
+ "page": all(x in page_src for x in ("VIEWS.rigtime", "['#/rigtime', 'Rig time']", "/api/rig-time/settings", "rtBars", "Lost vs targets")),
10907
+ "help": any(t_[0] == "rig-time" for t_ in H.INDEX) and not H.check("rig-time") and H.VIEW_TOPIC.get("rigtime") == "rig-time",
10908
+ }
10909
+ failed3 = [k for k, v in c3.items() if not v]
10910
+ ok(not failed3,
10911
+ "CP3 the pad's report and a well's, with their PDFs; the API (anyone signed in reads it; only an operator sets a target or a block "
10912
+ "weight, or writes a report; a target below zero refused); the CLI (the rig time, the report); the tab and the help page"
10913
+ + (f" [failed: {', '.join(failed3)}]" if failed3 else ""))
10914
+
10915
+
10613
10916
  def main() -> int:
10614
10917
  print("GEA-Program - ACCEPTANCE SUITE (the product gate)")
10615
10918
  # a handle a job subprocess still holds at the end must not turn a finished gate into a traceback on Windows:
@@ -10705,6 +11008,8 @@ def main() -> int:
10705
11008
  section_cl_history_and_dossier(tmp)
10706
11009
  section_cm_watch_and_alerts(tmp)
10707
11010
  section_cn_four(tmp)
11011
+ section_co_invoice_check(tmp)
11012
+ section_cp_rig_time(tmp)
10708
11013
  if _FAILS:
10709
11014
  print(f"[ACCEPTANCE] {len(_FAILS)} FAILURES ({_PASS} passed):")
10710
11015
  for f in _FAILS:
@@ -0,0 +1,15 @@
1
+ # The invoice cross-check
2
+
3
+ > The drilling contractor's daywork invoice, day by day, against the daily drilling reports and the drilling record, at the contract's terms as the operator declares them: each day AGREES, is in QUESTION, or DIFFERS, with the dollars each difference puts in question and the line it comes from.
4
+
5
+ **The command**: the **Invoice check** tab. Choose the well; declare the contract's terms once (where they came from, the hour the report day starts on the rig's clock and whether a report is dated by the day it starts or ends, the day rates - operating, and standby, repair, moving and force majeure where the contract has them - and the repair allowance in hours a job and a month); attach the daily drilling reports and the invoice as CSV files, each with its source. **Write the report** writes the client report with its PDF. From a terminal: `gea invoice-check --workspace C:\site --well W` prints the check; `--terms-source "..." --day-start 06:00 --operating 30000 --standby 25000 --repair 0 --repair-hours-month 24` declares the terms; `--attach-ddr FILE --source "..."` and `--attach-invoice FILE --source "..."` attach; `--write` writes the report; `--template ddr` or `--template invoice` prints the headings it reads.
6
+
7
+ **The files**: saved from a spreadsheet as CSV and read by their headings. A daily drilling report: one row per line of the time breakdown - Date (the report's), Hours (or From and To), Code (the IADC operation code) or Activity, and Depth From and Depth To where it has them. An invoice: one row per charge - Date (or From and To for a span), Rate Type (operating, standby, repair, moving, force majeure; anything else - fuel, rentals - is listed and not checked), Quantity, Unit (day or hour), and Unit Price or Amount.
8
+
9
+ **The checks**: the report's lines add up to 24 hours; hours reported drilling (code 2) against the record's hours on bottom making hole; the day's end depth and footage against the record's; a line coded drilling, reaming, circulating or trips over a span the record shows the pumps off, the rotary still and the bit still; a repair line over a span the record shows the rig working; more than 24 hours billed in a day, a day billed twice, billed with no report or nothing in the record; standby hours (code 33, or an activity that says standby or waiting on the operator's orders) billed at the operating rate; rig repair (code 8) past the allowance billed at the operating rate (IADC daywork contract, paragraph 4.4); a unit price that is not the contract's rate for its kind; quantity times price that is not the amount; and, as a question, a day billed at the operating rate on which the record shows the rig quiet six hours or more beyond the hours billed at standby, repair or force majeure.
10
+
11
+ **What it writes**: the files and their index in `economics\invoices\`, the terms in `economics\invoices\terms.json`, the audit lines `invoice.terms`, `invoice.attach`, `invoice.remove`, `report.invoice_check`, and the report in `reports\wells\<well>\invoice_check.*` (PDF, HTML, markdown, JSON), kept in report history.
12
+
13
+ **The number to check**: a day's dollars in question against its finding - the hours times the difference between the two rates, over 24; the record's hours against the well's charts for the same report day.
14
+
15
+ **What this page will not call a measurement**: what is owed - the contract and the parties decide; this sets three accounts side by side at the terms as declared. The clocks - the report's and the recorder's are taken to be the rig's same clock. Quiet time on the recorder - waiting on cement, rigging up and repairs within the allowance are operating time with the pumps off, so quiet is a question, not a difference. A charge that is not a day rate.
@@ -0,0 +1,15 @@
1
+ # Rig time
2
+
3
+ > What the rig did each second of the drilling record, read from the hook load, the block, the bit, the pumps and the rotary: the drilling connections timed weight to weight, the trips by speed, and the time lost against targets - the operator's declared targets, or this pad's own best quarter.
4
+
5
+ **The command**: the **Rig time** tab: the hours of each well by rig state, the drilling connections (weight to weight, and its three parts), each well's connections over time against the target, its trips and its report days; the targets and the block weight (the operator role); **Write the pad's report** or one well's. From a terminal: `gea rig-time --workspace C:\site` prints it; `--write` (with `--well W` for one well) writes the report; `--w2w-min 5 --trip-in 2500 --trip-out 2800 --source "drilling program"` declares targets; `--well W --block-weight 45` sets a well's block weight.
6
+
7
+ **The rig states**: IN SLIPS - the hook load below the block weight and half again, with the bit still (the rule rig-state software uses; the block weight is estimated from the hook load while the block moves and the bit does not, and printed); OFF THE HOOK - the same for half an hour or more (the string hung off, or no string: rigging, casing, waiting); ROTARY and SLIDE DRILLING - the record's own drilling samples, the rotary above 10 rpm or not; REAMING and WASHING - off bottom, pumping, the bit moving, with or without the rotary; CIRCULATING - pumping, the bit still; TRIPPING IN and OUT - the pumps off, the bit moving; STATIONARY - none of these.
8
+
9
+ **The connections and trips**: a drilling connection is a break of an hour or less between two stretches of drilling, with the string set in the slips and the bit kept within a stand of bottom: weight to weight from the last second drilling to the first second drilling again, made of off bottom to slips set, in the slips, and slips pulled to drilling. A trip is a run of tripping and the slips between its stands, the pumps off, split where the bit turns back 500 ft, that moves the bit 1,000 ft or more: its speed is its footage over its pipe-handling hours (moving and in the slips); the breaks inside it are reported beside it.
10
+
11
+ **What it writes**: the targets and block weights in `drillstring\rig_time.json`, the audit lines `rig_time.settings` and `report.rig_time`, and the reports `reports\rig_time_pad.*` and `reports\wells\<well>\rig_time.*` (PDF, HTML, markdown, JSON). The invoice check shows each report day's time lost beside the bill.
12
+
13
+ **The number to check**: a connection's weight to weight against the well's charts at its time; the block weight printed for each well against the rig's; a trip's footage over its hours.
14
+
15
+ **What this page will not call a measurement**: the cause of a long connection - a survey, a washout, a crew; the record shows the time, not the reason. A target beyond what this pad has done - the best quarter is this pad's own, not a technical limit. The slips themselves - a hook load threshold sees the weight leave the hook, and a block weight that differs from the estimate moves every slips time.
@@ -54,6 +54,8 @@ INDEX: List[tuple] = [
54
54
  ('report-history', 'Report history', 'every version of every client report kept in a dated folder with its SHA-256, when the next one replaces it'),
55
55
  ('pad-summary', 'The daily pad summary', 'one page each morning - what changed since the last one, what is due, what is still missing - kept in report history and sent through the notification rules'),
56
56
  ('dossier', 'The signed dossier', "a well's or the pad's reports, declarations, audit log and source hashes in one zip signed with the site's Ed25519 key, with a checker anyone can run without GEA"),
57
+ ('rig-time', 'Rig time', "what the rig did each second of the drilling record - drilling, the slips, tripping, circulating - its connections timed weight to weight, its trips by speed, and the time lost against the pad's own best quarter"),
58
+ ('invoice-check', 'The invoice cross-check', "the drilling contractor's daywork invoice, day by day, against the daily drilling reports and the drilling record at the contract's terms: hours, rates, standby, the repair allowance, depth and footage, with the dollars each difference puts in question"),
57
59
  ('economics', 'Economics', 'each well\'s days, footage and cost by the operator\'s own declared rates, against the EIA oil and gas spot prices while it was drilled, and any series the site imports'),
58
60
  ('well3d', 'The well in 3D', 'each well\'s path from its directional survey, set among the mapped formation surfaces and contours with its picks, coloured by what was measured along it, and the drill string replayed from the record; the Volve field shipped as the worked example'),
59
61
  ('charts', 'The charts', 'a well\'s channels stacked on one axis with a linked cursor, zoom and pan from every sample, time or depth for a drilling recorder, the depth events marked, and the drilling progress of every well'),
@@ -84,7 +86,7 @@ REQUIRED_LINES = ('**The command**', '**What it writes**', '**The number to chec
84
86
  VIEW_TOPIC: Dict[str, str] = {
85
87
  'home': 'start', 'wells': 'data-in', 'well': 'drift', 'live': 'patches', 'patch': 'patches', 'files': 'files', 'alarms': 'alarms',
86
88
  'approvals': 'well-tests', 'config': 'site', 'reports': 'drift', 'verify': 'start', 'survey': 'data-in', 'jobs': 'site',
87
- 'admin': 'site', 'prefs': 'site', 'search': 'start', 'welcome': 'start', 'seismic': 'seismic', 'seismic_station': 'seismic', 'track': 'seismic', 'sar': 'seismic', 'sites': 'sites', 'setup': 'setup', 'map': 'map', '3d': 'well3d', 'simulation': 'simulation', 'drillstring': 'drillstring', 'completion': 'penetrator', 'opseis': 'opseis', 'economics': 'economics', 'control': 'control-room', 'wall': 'control-room', 'audit': 'audit-update', 'tools': 'tools', 'catalog': 'catalog',
89
+ 'admin': 'site', 'prefs': 'site', 'search': 'start', 'welcome': 'start', 'seismic': 'seismic', 'seismic_station': 'seismic', 'track': 'seismic', 'sar': 'seismic', 'sites': 'sites', 'setup': 'setup', 'map': 'map', '3d': 'well3d', 'simulation': 'simulation', 'drillstring': 'drillstring', 'completion': 'penetrator', 'opseis': 'opseis', 'economics': 'economics', 'invoices': 'invoice-check', 'rigtime': 'rig-time', 'control': 'control-room', 'wall': 'control-room', 'audit': 'audit-update', 'tools': 'tools', 'catalog': 'catalog',
88
90
  }
89
91
 
90
92