Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Feb 20, 2024
1 parent cdc1da8 commit 9ce7416
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion parser/MzIdParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,10 @@ def write_new_upload(self):
table = 'upload'

response = self.writer.write_new_upload(table, upload_data)
self.writer.upload_id =int(response)
if response:
self.writer.upload_id =int(response)
else:
raise Exception("Response is not available to create a upload ID")
except SQLAlchemyError as e:
print(f"Error during database insert: {e}")

Expand Down
10 changes: 10 additions & 0 deletions parser/api_writer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import traceback
import requests
import json

from config.config_parser import get_api_configs
from parser.writer import Writer
Expand Down Expand Up @@ -27,6 +28,9 @@ def write_data(self, table, data):
"table": table,
"data": data,
}
# Calculate the size of the payload
payload_size = len(json.dumps(payload))
print("Payload Size:", payload_size) # Print the payload size
response = requests.post(url=API_ENDPOINT, headers=headers, json=payload)
response.raise_for_status()

Expand Down Expand Up @@ -57,6 +61,9 @@ def write_new_upload(self, table, data):
"table": table,
"data": data,
}
# Calculate the size of the payload
payload_size = len(json.dumps(payload))
print("write_new_upload Payload Size:", payload_size) # Print the payload size
response = requests.post(url=API_ENDPOINT, headers=headers, json=payload)
response.raise_for_status()

Expand Down Expand Up @@ -90,6 +97,9 @@ def write_mzid_info(self, analysis_software_list, spectra_formats,
"samples": samples,
"bib": bib,
}
# Calculate the size of the payload
payload_size = len(json.dumps(payload))
print("write_mzid_info Payload Size:", payload_size) # Print the payload size
response = requests.post(url=API_ENDPOINT, headers=headers, json=payload)
response.raise_for_status()
result = response.json()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_version(rel_path):

setup(
name="xi-mzidentml-converter",
version="0.1.17",
version="0.1.19",
description="xi-mzidentml-converter uses pyteomics (https://pyteomics.readthedocs.io/en/latest/index.html) to parse mzIdentML files (v1.2.0) and extract crosslink information. Results are written to a relational database (PostgreSQL or SQLite) using sqlalchemy.",
long_description_content_type="text/markdown",
long_description=long_description,
Expand Down

0 comments on commit 9ce7416

Please sign in to comment.