ukaea / multiparser Goto Github PK
View Code? Open in Web Editor NEWMultiple File Parser for monitoring and processing updates to a given set of output files.
Home Page: https://ukaea.github.io/Multiparser/
License: MIT License
Multiple File Parser for monitoring and processing updates to a given set of output files.
Home Page: https://ukaea.github.io/Multiparser/
License: MIT License
Describe the bug
To Reproduce
import multiparser.parsing.file as mp_file_parser
import multiparser
import os
import json
class MyRun:
@mp_file_parser.file_parser
def _my_parser(
self,
input_file: str,
**__):
return {}, json.load(input_file)
def _my_callback(
self,
data,
metadata
):
print(data)
def launch(self):
"""Method which launches the simulation and the monitoring.
By default calls the three methods above, and sets up a FileMonitor for tracking files.
"""
# Start an instance of the file monitor, to keep track of log and results files
with multiparser.FileMonitor(
) as self.file_monitor:
# Monitor each file created by a Vector PostProcessor, and upload results to Simvue if file matches an expected form.
self.file_monitor.track(
path_glob_exprs = "test.json",
parser_func = self._my_parser,
callback = self._my_callback
)
self.file_monitor.run()
myrun = MyRun()
myrun.launch()
Expected behavior
Environment (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.