Skip to content

Conversation

@staleyLANL
Copy link
Contributor

Based on having used it in another code, I made some improvements to the Simple JSON interface, and have uploaded the changes here. All builds and tests (C++ and Python) were verified to still work properly.

Basically, that was for consistency.
Did a bit of reformatting in json2class.cpp.
Small changes in a couple of scripts.
nameClass() doesn't use any "name" override in a key's value,
but always uses the key itself.
In preparation for putting together a GNDS 2.0 interface, I wanted to improve the way in which current content was organized.

We had "prototype" GNDS 1.9 input specs in the autogen directory. However, calling it even a "prototype" was a bit much, because it had so little of the actual, full GNDS 1.9 specification. More accurately, it was simply an example of using the code generator. It wasn't even close to being GNDS 1.9.

The code generator's inputs for this "prototype" were placing "v1.9" content into GNDStk/python/src and GNDStk/src/v1.9. That is, the content was going into the GNDStk repo's root directory. Given that this thing isn't really GNDS 1.9 by any stretch of the imagination, that output never really belonged in the root directory. Rather, it belonged in the autogen directory, under prototype.

So, I moved the appropriate content to where I believe it belongs. Note that the general core-interface material (source and tests) remains in GNDStk/python. Only the not-really-"v1.9" files were moved.

Various CMake-related files as well as C++ files were updated to reflect the move.

How, precisely, we'll arrange GNDS 2.0 and GNDS [future-version] material is to be determined. @whaeck's dev/gnds-2.0 has them in GNDStk/standards, which I think is a good place. For the code that we'll generator for GNDS 2.0, etc., I'd say that we should remain in that directory structure, rather that going upwards to the main GNDStk/ directory as we originally did with the prototype.
Accounting for both Wim's changes and the current (2022-aug-23) master branch at git.oecd-nea.org
I'm putting back in the nodes that create "circularity" issues, so that I can identify precisely where it happens, and fix it properly.
This is all currently a work in progress!
Small coloring change in utility.
Added some files to to-process list in gnds-2.0 json spec.
Not really important, but noticed it while working with v2.0.
In each case, the metadatum in question had a default. When a metadatum has a default, that implies that it shouldn't be required. If, in contrast, it turns out that we want to require any of the metadata in question, then we should remove their defaults.
Same reasoning as a few minutes ago, with summary_tsl.json.
These will be temporary, at least in this (try/ directory) location.

But I want to have these, now, in order to help ensure that upcoming code and spec changes have the effects -- and only the effects -- that I want them to have.

In the code generator, I replaced an assert with a meaningful error message, regarding times/occurrence. More work on the code generator will be forthcoming. (And hence one reason for putting in the slew of new files as described above.)
At least, it accepts enumerator names, but doesn't fully deal with enumerator values yet.

Accepting enumerator names allowed us to fully autogenerate other codes that needed, for example, to #include or wrap (for Python) the enumerators.

Fully handling individual values (in a given enum class) is slated for the future. In this way, we'll be able to generate code that are currently handwritten in GNDStk/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/.
Uploading work done earlier this week.
Not quite functional yet. Added so we can track changes.
Note: re-autogenerated C++ files in prototype/ break the build right now.
So, I'm not committing them right now.

This has something to do with enums having been moved from njoy::GNDStk:: to specific code-generation places (an earlier change, and done for good reasons). I need to soup in prototype/ material to have the requisite enums directly, but may or may not have time for that right now.
Small changes with some autogenerated C functions.
staleyLANL and others added 7 commits February 1, 2024 13:22
Working on this for another project, but relevant here.
Also needed it in certain autogenerated codes,
and thus in the code generator.
Experience with another compiler called out this issue.
It related to pybind11's using std::foo rather than foo.
Which apparently sometimes requires <cstdint>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants