Skip to content

Commit

Permalink
bug in db.py fixed. tutorials reuploaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
shanto268 committed Dec 22, 2023
1 parent 45208dc commit 74c4501
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='SQuADDS',
version='0.1.4',
version='0.1.5',
packages=find_packages(),
description='Our project introduces an open-source database of programmatically generated and experimentally validated superconducting quantum device designs, accessible through a user-friendly interface, significantly lowering the entry barrier for research in this field.',
long_description=open('README.md').read(),
Expand All @@ -15,7 +15,7 @@
author_email='shanto@usc.edu',
include_package_data=True,
url='https://github.com/LFL-Lab/SQuADDS',
# install_requires=required, # required for pypi installations
install_requires=required, # required for pypi installations
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
Expand Down
42 changes: 42 additions & 0 deletions squadds/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,48 @@ def select_coupler(self, coupler=None):
self.view_component_names("coupler")
return

def see_dataset(self, data_type=None, component=None, component_name=None):
# Use the instance attributes if the user does not provide them
component = component if component is not None else self.selected_system
component_name = component_name if component_name is not None else self.selected_component_name

# Check if system and component_name are still None
if component is None or component_name is None:
print("Both system and component name must be defined.")
return

if data_type is None:
print("Please specify a data type.")
return

# Check if the component is supported
if component not in self.supported_components():
print("Component not supported. Available components are:")
print(self.supported_components())
return

# Check if the component name is supported
if component_name not in self.supported_component_names():
print("Component name not supported. Available component names are:")
print(self.supported_component_names())
return

# Check if the data type is supported
if data_type not in self.supported_data_types():
print("Data type not supported. Available data types are:")
print(self.supported_data_types())
return

# Construct the configuration string based on the provided or default values
config = f"{component}-{component_name}-{data_type}"
try:
df = load_dataset(self.repo_name, config)["train"].to_pandas()
return flatten_df_second_level(df)
except Exception as e:
print(f"An error occurred while loading the dataset: {e}")
return


def get_dataset(self, data_type=None, component=None, component_name=None):
# Use the instance attributes if the user does not provide them
component = component if component is not None else self.selected_system
Expand Down
Binary file modified tutorials/qubit_only.png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/qubit_only.png750.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74c4501

Please sign in to comment.