Skip to content

Commit

Permalink
Make graphics for presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Wise committed Jun 17, 2022
1 parent fab7552 commit ff68d0b
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "PlantUML",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/docs/source/plantuml/ExportDiagrams.py",
"cwd": "${workspaceFolder}"
}
]
}
Binary file added docs/source/images/Dataforensics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/KeynetixCSVExportLicense.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/KeynetixConverter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/KeynetixToolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions docs/source/plantuml/ExportDiagrams.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import pathlib

import plantuml

PLANT_PATH = r'C:\Source\plantuml.jar'

def export():
is_local = os.path.exists(PLANT_PATH)
if is_local:
print('Using local PlantUML jar.')
else:
print('Using PlantUML server.')
puml = plantuml.PlantUML('http://www.plantuml.com/plantuml/img/')

plant_dir = pathlib.Path(__file__).parents[0]
docs_dir = plant_dir.parents[0]
for input_file in plant_dir.glob('*.puml'):
# for file_name in ['KeynetixConverter.puml']:
# input_file = plant_dir / file_name
print(input_file.name)
output_name = input_file.name.replace('.puml', '.png')
output_dir = docs_dir.joinpath('images')
output_file = output_dir.joinpath(output_name)
if is_local:
os.system('java -jar {} {} -o {}'.format(PLANT_PATH, input_file, output_dir))
else:
puml.processes_file(input_file, output_file)

if __name__ == '__main__':
export()
9 changes: 9 additions & 0 deletions docs/source/plantuml/KeynetixConverter.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@startuml KeynetixConverter

(gINT) -down-> (Excel)
(AGS) -down-> (Excel)
(Excel) -down-> (DIGGS)
(Excel) -down-> (CSV)
(Excel) -down-> (KeyLAB)

@enduml
24 changes: 12 additions & 12 deletions src/pydiggs/boringlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ def __init__(self):
def extract_xml(self, input_path):
pydiggs_dir = pathlib.Path(__file__).parents[0]
xsd = str(pydiggs_dir.joinpath('schema', 'Complete.xsd'))
schema = xmlschema.XMLSchema(xsd)
# schema = xmlschema.XMLSchema(xsd)
# xml_data = schema.to_dict('tests/test_cases/examples/collection/collection.xml')
self.log_data['boring_id'] = 'temp'
# self.log_data['boring_id'] = 'temp'

# namespace = {
# 'default': 'http://diggsml.org/schemas/2.5.a',
# 'gml': 'http://www.opengis.net/gml/3.2'
# }
# tree = ET.parse(input_path)
# root = tree.getroot()
# first_feature = root.find('default:samplingFeature', namespace)
# borehole = first_feature.find('default:Borehole', namespace)
# name = borehole.find('gml:name', namespace)
# self.log_data['boring_id'] = name.text
namespace = {
'default': 'http://diggsml.org/schemas/2.5.a',
'gml': 'http://www.opengis.net/gml/3.2'
}
tree = ET.parse(input_path)
root = tree.getroot()
first_feature = root.find('default:samplingFeature', namespace)
borehole = first_feature.find('default:Borehole', namespace)
name = borehole.find('gml:name', namespace)
self.log_data['boring_id'] = name.text

def to_pdf(self, output_path):
# output_text = '<p>Pretend this is a boring log.</p>'
Expand Down

0 comments on commit ff68d0b

Please sign in to comment.