Comments (7)
I think has something to do with the asdf
directive, however it's a bit complicated so I didn't find a quick solution.
In the meantime I've fixed the sphinx version to <1.3.5 in #194 so they won't show up in every PR.
from asdf.
Yes, it's in the definition of the AsdfDirective
class but I haven't had time to look into it.
It's a warning that Pygments
could not do correct language highlighting so it's not critical although it would be nice to fix it.
from asdf.
The problem appears to be here. The problem is that the AsdfDirective
is creating a single literal_block
node containing the ASDF header followed by the YAML tree. The whole block is marked as having the language "yaml", but the ASDF header is not valid YAML (well, arguably it's a comment in YAML, but my guess--and I haven't confirmed this--is that the syntax highlighter doesn't support comments coming before the %YAML
directive).
Technically, according to the low-level layout of the ASDF format the header is a separate section of the file from the YAML tree anyways. So I think a fix to this would be to change the AsdfDirective
slightly to output the header in a separate literal node from the tree (just as it outputs the block headers as a separate node currently).
from asdf.
Nevermind--that doesn't appear to be exactly the issue after all. I tested it and the yaml highligher from pygments had no problem with this, at least not directly (still might make sense to put the header in a separate node though).
from asdf.
Okay, I think I see where the problem probably is. I think it's a bug in the pygments lexer. It's barfing on lines like this one:
asdf_library: !core/software-1.0.0 {author: Space Telescope Science Institute, homepage: 'http://github.com/spacetelescope/asdf',
name: asdf, version: 1.1.0.dev722}
If I remove the !core/software-1.0.0
tag it works. So it seems that it can't handle an inline map element split across multiple lines if it is preceded by a tag.
Update: Further narrowed it down. It's fine with having a tag there, but it doesn't like the /
in the tag name.
from asdf.
Here we go:
https://bitbucket.org/birkenfeld/pygments-main/pull-requests/584/fix-incorrect-lexing-of-yaml-tags/diff
In principle we can work around this now by monkey-patching. The AsdfDirective
(or the module containing it) can import the YamlLexer
from pygments
and update YamlLexer.tokens['descriptors']
to use my updated regexp.
from asdf.
My fix to the pygments lexer has been merged.
from asdf.
Related Issues (20)
- Add schema manifest providing package version to asdf metadata and check schema packages on read
- Update `setuptools_scm` `write_to`
- Retire the "stable" branch HOT 4
- Combine package and build workflows
- masked arrays do not roundtrip with all false masks
- `AsdfSpec` misses expected match
- deprecate `AsdfSpec` and `format_tag`
- Tracking `sunpy` 6.0 and ASDF 1.6.0 HOT 1
- Old (<2.14) versions of asdf do not fully support ASDF standard 1.6.0
- `AsdfFile` instances are not pickleable HOT 1
- Chunking support HOT 2
- Investigate enabling `validate_checksum` as default `True`
- Investigate returning `ndarray` when `lazy_load=False` HOT 6
- Change scope of ndarray custom validators HOT 1
- Add to docs comparison of `tag` vs `$ref` usage in schema.
- Consider a new design for the info and search methods that avoids conversion of nodes when the lazy_tree option is used
- Fix stable docs version in RTD
- FAILED asdf/_tests/test_yaml.py::test_implicit_conversion_warning HOT 3
- `assert_tree_match` and `np.testing` ignores array masks
- Schema_info Returning Non Schema Keyword HOT 2
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 asdf.