Comments (3)
PyNMR-STAR uses the standard Python logging module to log these warnings. You can configure their behavior (including diverting them to a specific file, silencing them, etc.) using the configuration options available in the logging module.
As an example, to increase the log level (and suppress these warnings) the following (prior to parsing a loop) should suffice:
import logging
logging.getLogger().setLevel(logging.ERROR)
Empty loops are technically forbidden in NMR-STAR, though they are allowed in STAR. In practice, files with empty loops do exist, which is why the issue is only warned about, as opposed to being an actual exception.
from pynmrstar.
from pynmrstar.
Hey Gary,
I suspect you may run into a few other corner cases where the behavior of this library isn't ideal for pure STAR parsing (versus NMR-STAR parsing), though I would certainly to like facilitate, to the extent possible, the use of this library for working with NEF, so I appreciate you bringing any of these issues to my attention.
It may be worth me creating a special NEFEntry class (and similar for Saveframes and Loops) in the future to enable using the library for this purpose without needing workarounds.
I believe that you are correct regarding filters - you should be able to create a filter that will filter out the specific message being discussed here. (Alternatively, and certainly more hacky, is to reset the log level to whatever you desire after parsing an Entry - since PyNMRSTAR throws an exception for any true exceptions, and only logs warnings, so this will almost never lead to the suppression of anything meaningful during parsing.)
from pynmrstar.
Related Issues (20)
- Files without categories read ok HOT 2
- A typo in error message HOT 2
- pynmrstar library should not use logging.basicConfig HOT 3
- odd behaviour of frame_codes HOT 2
- pynmrstar should use its own logger?! HOT 4
- get Loop tags without category HOT 5
- read rows in loops as a dictionary HOT 11
- should PyNMRSTAR describe itself as a star file parser HOT 7
- ValueError: You cannot have two loops with the same category in one saveframe HOT 21
- When checking `empty` property in a loop, ignore Entry_ID and similar tags HOT 1
- Improvement for ValueError message HOT 6
- Document that python 3 is required in metadata so pip for python 2 will not go after newer versions HOT 1
- Show a better error message when a user attempts to render a file with an empty string
- Data loss occurred while output if proper key tag was missing HOT 2
- Release 3? HOT 4
- When validating an entry, ensure that saveframe pointers point to saveframes of the correct category HOT 2
- If loading an entry fails with a 403, implement an exponential back off and retry rather than throwing an IOError
- Change write_to_file() defaults to preserve empty tags and loops HOT 1
- Problem frame without tags won't print loop HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pynmrstar.