Commit 88166032 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed readme

parent 7fbb08a7
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
The NoMaD parser for CP2K. Under development. Will be modified to conform to The NoMaD parser for CP2K. Under development. Will be modified to conform to
the common parser structure when it is available. the common parser structure when it is available.
--- # QuickStart
## QuickStart
- Clone repository - Clone repository
```shell ```shell
...@@ -31,21 +30,20 @@ the common parser structure when it is available. ...@@ -31,21 +30,20 @@ the common parser structure when it is available.
```shell ```shell
python -m cp2kparser python -m cp2kparser
``` ```
---
## Structure # Structure
Currently the python package is divided into three subpackages: Currently the python package is divided into three subpackages:
- Engines: Classes for parsing different type of files - Engines: Classes for parsing different type of files
- Generics: Generic utility classes and base classes - Generics: Generic utility classes and base classes
- Implementation: The classes that actually define the parser functionality. - Implementation: The classes that actually define the parser functionality.
--- # Reusable components and ideas for other parsers
## Reusable components and ideas for other parsers
Some components and ideas could be reused in other parsers as well. If you find Some components and ideas could be reused in other parsers as well. If you find
any of the following ideas useful in you parser, you are welcome to do reuse any of the following ideas useful in you parser, you are welcome to reuse
them. them.
### Engines ## Engines
Basically all the "engines", that is the modules that parse certain type of Basically all the "engines", that is the modules that parse certain type of
files, are reusable as is in other parsers. They could be put into a common files, are reusable as is in other parsers. They could be put into a common
repository where other developers can improve and extend them. One should also repository where other developers can improve and extend them. One should also
...@@ -64,8 +62,9 @@ Currently implemented engines that could be reused (not tested properly yet): ...@@ -64,8 +62,9 @@ Currently implemented engines that could be reused (not tested properly yet):
- XYZEngine: For parsing XYZ files and files with similar structure. Has a very - XYZEngine: For parsing XYZ files and files with similar structure. Has a very
flexible nature as you can specify comments, column delimiters, column flexible nature as you can specify comments, column delimiters, column
indices and the patterns used to separate different configurations. indices and the patterns used to separate different configurations.
- XMLEngine: For parsing XML files using XPath syntax.
### NomadParser base class ## NomadParser base class
In the generics folder there is a module called nomadparser.py that defines a In the generics folder there is a module called nomadparser.py that defines a
class called NomadParser. This acts as a base class for the cp2k parser defined class called NomadParser. This acts as a base class for the cp2k parser defined
in the implementation folder. in the implementation folder.
...@@ -81,20 +80,20 @@ parsers: ...@@ -81,20 +80,20 @@ parsers:
- Time measurement for performance analysis - Time measurement for performance analysis
- Providing file contents, sizes and handles - Providing file contents, sizes and handles
### Logging ## Logging
Python has a great [logging package](https://www.google.com) which helps in Python has a great [logging package](https://www.google.com) which helps in
following the program flow and catching different errors and warnings. In following the program flow and catching different errors and warnings. In
cp2kparser the file cp2kparser/generics/logconfig.py defines the behaviour of cp2kparser the file cp2kparser/generics/logconfig.py defines the behaviour of
the logger. There you can setup the log levels even at a modular level. A more the logger. There you can setup the log levels even at a modular level. A more
easily readable formatting is also provided for the log messages. easily readable formatting is also provided for the log messages.
### Testing ## Testing
The parsers can become quite complicated and maintaining them without The parsers can become quite complicated and maintaining them without
systematic testing is perhaps not a good idea. Unittests provide one way to systematic testing is perhaps not a good idea. Unittests provide one way to
test each parseable quantity and python has a very good [library for test each parseable quantity and python has a very good [library for
unittesting](https://docs.python.org/2/library/unittest.html). unittesting](https://docs.python.org/2/library/unittest.html).
### Profiling ## Profiling
The parsers have to be reasonably fast. For some codes there is already The parsers have to be reasonably fast. For some codes there is already
significant amount of data in the NoMaD repository and the time taken to parse significant amount of data in the NoMaD repository and the time taken to parse
it will depend on the performance of the parser. Also each time the parser it will depend on the performance of the parser. Also each time the parser
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment