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

pushing working parser #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

diyorg07
Copy link

No description provided.

@thomas-robinson
Copy link
Owner

thomas-robinson commented Oct 28, 2019

@diyorzakirov07 please use doxygen-style python comments and include at least a \brief section for all functions.

parseShort.py Outdated
Comment on lines 12 to 14
#The regex creates a pattern to find matches in the file
#Checks for USE and possible & on the same or next line, until module name is found signified by the '?'
#Ignores cases and tries to match on all lines
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use doxygen comments, preferably the ## style suggested here

parse.py Outdated
if md == mods[0]:
alreadyExists = True
if vv:
print(fname,": the module ",md," is listd more than once. only keeping one")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in "listed"

parse.py Outdated
if md == mods[0]:
alreadyExists = True
if vv:
print(fname,": the module ",md," is listd more than once. only keeping one")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diyorzakirov07 another "listed" typo

@thomas-robinson
Copy link
Owner

thomas-robinson commented Oct 28, 2019

@diyorzakirov07 how should I run this? Can you updated the README for running instructions?

@diyorg07
Copy link
Author

@thomas-robinson only parseShort.py actually runs, you should be able to just call for the main method and it would print the array with module dependencies

@thomas-robinson
Copy link
Owner

thomas-robinson commented Oct 29, 2019

@diyorzakirov07 i tried ./parserTest.py diag_manager.F90 and it didn't work. When I did python parserTest.py diag_manager.F90 the script ran. I also tried python parserTest.py diag_manager.F90 --verbose but no additional information was printed out.

thomas-robinson pushed a commit that referenced this pull request Nov 14, 2019
@thomas-robinson
Copy link
Owner

@diyorzakirov07 When I run mkmf, I get this printed out:

------------------------------
False
False
Done
------------------------------

This seems like some debugging prints that should be taken out.

When I run outside of the mkmf directory:

> mkmf2/mkmf2 atmos_param/
------------------------------
False
False
Traceback (most recent call last):
  File "mkmf2/mkmf2", line 61, in <module>
    writeModules(sys.argv[1], verbose, vv, recursive, mainDir)
  File "/net2/Thomas.Robinson/mkmf2/parseShort.py", line 179, in writeModules
    fileList = os.listdir(path)
OSError: [Errno 2] No such file or directory: 'atmos_param/'

When I run for FMS xanadu with a bunch of extra junk:

> mkmf2 ../FMS
------------------------------
False
False
Traceback (most recent call last):
  File "mkmf2", line 61, in <module>
    writeModules(sys.argv[1], verbose, vv, recursive, mainDir)
  File "/net2/Thomas.Robinson/mkmf2/parseShort.py", line 222, in writeModules
    MODULESINIT_str += (getFileModuleName(file) + ".$(FC_MODEXT) : " + file.split('.')[0] + ".$(OBJEXT)\n")
  File "/net2/Thomas.Robinson/mkmf2/parseShort.py", line 89, in getFileModuleName
    fileContents = open(fileName, encoding = 'latin-1').read()
TypeError: 'encoding' is an invalid keyword argument for this function

When I run with a clean FMS (xanadu), is runs to completion.

Your -v and -vv options list "Files to parse:", but the list is actually the directories. The -vv option should list each individual file, and maybe even the dependencies. The -v option could just list the file being worked on. They should both list any CPPDEFS or other options.

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.

2 participants