Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to eliminate quotation marks from output? #168

Open
coderodyhpc opened this issue Jan 11, 2025 · 1 comment
Open

How to eliminate quotation marks from output? #168

coderodyhpc opened this issue Jan 11, 2025 · 1 comment

Comments

@coderodyhpc
Copy link

Hello,
I'm having trouble getting rid of quotation marks when writing some variables. A snippet reads

        self.variable1 = 'test',
        self.variable2 = 'true',
        init['variables'] = OrderedDict(
            variable1 = self.variable1,
            variable2 = self.variable2,
        )
        nml = f90nml.Namelist(init)  
        nml.indent = 2
        nml.write('file name', force=True) 

which writes

&variables
  variable1 = 'test',
  variable2 = 'true',

when I need to have:

&variables
  variable1 = 'test',
  variable2 = true,

I have unsuccessfully tried to get rid of the 2nd quotation marks. Is there any way that this can be achieved in an elegant fashion?
Thanks.

@marshallward
Copy link
Owner

marshallward commented Jan 11, 2025

I'm not sure that level of detail is currently possible. Even the global string delimiter is not definable at the moment. It currently just uses Python's repr() intrinsic, which preferentially uses '.

This sort of thing could be made to work, but I think it would require a bit more object design for each element, or maybe a table of style settings for each element. But I can't see this happening in the near future.

Sorry that I don't have better news, but I will leave the issue open as a feature request.

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

No branches or pull requests

2 participants