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

Fix test_db.py failure caused by gaia_ptr_t refactoring #1139

Merged
merged 3 commits into from
Dec 14, 2021

Conversation

simone-gaia
Copy link
Contributor

@simone-gaia simone-gaia commented Dec 14, 2021

  • Change gaia_ptr_t::open to gaia_ptr_t::from-gaia_id()
  • Remove trailing ;

Note: I haven't been able to build the python stuff on my machine for a while. Running a CI build to see if this is actually working:

@@ -3,36 +3,36 @@
# All rights reserved.
#############################################

from gaia_db_pybind import *;
Copy link
Contributor

Choose a reason for hiding this comment

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

Python a bit rusty eh?

Choose a reason for hiding this comment

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

+1

type = 1;
done = False;
type = 1
done = False
while not(done):

Choose a reason for hiding this comment

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

while not done:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


print("Iterating through nodes of type: " + str(type) + "...");
node_iter = gaia_ptr.find_first(type);
print("Iterating through nodes of type: " + str(type) + "...")

Choose a reason for hiding this comment

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

personally, I would use f-strings if you are comfortable with them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can;t compile/run this thing locally so I would refrain from that. (otherwise I would)

print("Iterating through nodes of type: " + str(type) + "...");
node_iter = gaia_ptr.find_first(type);
print("Iterating through nodes of type: " + str(type) + "...")
node_iter = gaia_ptr.find_first(type)

if (node_iter.is_null() == True):

Choose a reason for hiding this comment

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

if node_iter.is_null():

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

print("No nodes of type " + str(type) + " were found!");
no_node = True;
print("No nodes of type " + str(type) + " were found!")
no_node = True

while node_iter.is_null() != True:

Choose a reason for hiding this comment

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

+1


type = type + 1;

Choose a reason for hiding this comment

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

type += 1

Copy link

@JackAtGaia JackAtGaia left a comment

Choose a reason for hiding this comment

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

Generally, I would say that we should use one of my lint.sh scripts on this, but it may be overkill.

It is not great Python, but should work fine.

@simone-gaia simone-gaia merged commit e551401 into master Dec 14, 2021
@simone-gaia simone-gaia deleted the rondelli-python-fix branch December 14, 2021 23:06
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