Skip to content

Commit

Permalink
fix: Bug in accessing simulation data from HuggingFace has been patched
Browse files Browse the repository at this point in the history
Added [FAQ](https://lfl-lab.github.io/SQuADDS/source/getting_started.html#accessing-the-database) for issue with accessing HF data on SQuADDS releases <= 0.2.35
  • Loading branch information
shanto268 committed Jul 5, 2024
1 parent cb49504 commit 00adeb1
Show file tree
Hide file tree
Showing 10 changed files with 38,379 additions and 38,458 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
project = 'SQuADDS'
copyright = '2023, Sadman Ahmed Shanto & Eli Levenson-Falk'
author = 'Sadman Ahmed Shanto'
release = "0.2.34"
release = "0.2.35"

# General configuration
exclude_patterns = [
Expand Down
9 changes: 5 additions & 4 deletions docs/source/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Developers

| `Sadman Ahmed Shanto <https://www.sadmanahmedshanto.com>`_ (University of Southern California) - Project Lead 🙏🏽
| Andre Kuo (University of Southern California)
| Elizabeth Kunz (University of Southern California)
| `Elizabeth Kunz <https://www.linkedin.com/in/elizabeth-kunz-644848207/>`_ (University of Southern California)

Contributors
Expand All @@ -40,11 +40,12 @@ Contributors
| **Madison Howard** (California Institute of Technology) - Bug Hunter 🐛
| **Malida Hecht** (University of Southern California) - Data contributor 📀
| **Evangelos Vlachos** (University of Southern California) - Code contributor 💻 and Bug Hunter 🐛
| **Anne Whelan** (University of Southern California) - Documentation contributor 📄
| **Jenny Huang** (University of Southern California) - Documentation contributor 📄
| **Anne Whelan** (US Navy) - Documentation contributor 📄
| **Jenny Huang** (Columbia University) - Documentation contributor 📄
| **Connie Miao** (Stanford University) - Data Contributor 📀
| **Daria Kowsari, PhD** (University of Southern California) - Data contributor 📀
| **Vivek Maurya** (University of Southern California) - Data contributor 📀
| **Haimeng Zhang, PhD** (IBM) - Data contributor 📀
| **Ethan Zheng** (University of Southern California) - Data scrubber 🧼
| **Sara Sussman, PhD** (Fermilab) - Bug Hunter 🐛
| **Sara Sussman, PhD** (Fermilab) - Bug Hunter 🐛
| **Adhish Chakravorty** (University of Southern California) - Bug Hunter 🐛
20 changes: 11 additions & 9 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ You can use the GitHub version of SQuADDS as well by changing Step 4 to
pip install -r requirements.txt
pip install -e .
********************************
FAQ's
********************************
Expand All @@ -91,29 +90,31 @@ FAQ's
Installation Issues
--------------------

**Q: Getting**``ModuleNotFoundError: No module named 'squadds'``**after running `pip install SQuADDS` in Jupyter Notebook. How can I fix this?**

**Q: Getting** ``ModuleNotFoundError: No module named 'squadds'`` **after running** `pip install SQuADDS` **in Jupyter Notebook. How can I fix this?**

**A:** You may need to restart the kernel after installing `SQuADDS`. To do this, go to the `Kernel` menu in Jupyter Notebook and select `Restart`.

-----------------------
Accessing the Database
-----------------------

Q: **If there are errors upon instantiating the **``SQuADDS_DB``**class, what should I do?**
**Q: I am getting the error** ``KeyError: "Column contributor not in the dataset. Current columns in the dataset: ['image', 'measured_results', 'contrib_info', 'design_code', 'notes', 'sim_results', 'paper_link']"`` **for various** `SQuADDS_DB()` **methods (e.g.** `SQuADDS_DB().view_all_contributors()`**). Everything was working fine just the other day.**

**A:** This error is due to new datasets (configs) added to ``SQuADDS/SQuADDS_DB`` dataset on 07/04/2024 (🇺🇸 🦅 🎆). To fix this issue please upgrade ``squadds`` to its latest version (or any version greater than or equal to 0.2.35).

**A:** If you encounter errors upon instantiating the ``SQuADDS_DB`` class, chances are there is an issue with caching. To fix this, please delete the ``SQuADDS`` dataset from the huggingface cache directory on your local machine. The cache directory is typically located at ``~/.cache/huggingface/datasets/``.
**Q: If there are errors upon instantiating the** `SQuADDS_DB` **class, what should I do?**

**A:** If you encounter errors upon instantiating the `SQuADDS_DB` class, chances are there is an issue with caching. To fix this, please delete the ``SQuADDS`` dataset from the huggingface cache directory on your local machine. The cache directory is typically located at ``~/.cache/huggingface/datasets/``.

-------------
``.env`` File
-------------


Q: **Why is the ``.env`` file needed?**
**Q: Why is the** ``.env`` **file needed?**

**A:** The ``.env`` file is needed for making contributions to the SQuADDS Database.

Q: **What info should the ``.env`` file contain?**
**Q: What info should the** ``.env`` **file contain?**

**A:** The ``.env`` file should have the following fields defined.

Expand All @@ -138,12 +139,13 @@ You can set these fields via the SQuADDS API.
set_huggingface_api_key()
set_github_token()
Q: **Where is the ``.env`` file created or should be placed for it to function properly?**
**Q: Where is the** ``.env`` **file created or should be placed for it to function properly?**

**A:** The ``.env`` file should be automatically created at the right place within the root directory of the ``SQuADDS`` package. If the ``.env`` file is not automatically created upon installation, you will need to manually create it at this specific location for ``SQuADDS`` to function properly.

To determine the installation root of ``SQuADDS``, and subsequently place or find the ``.env`` file, use the following approach:


.. code-block:: python
from pathlib import Path
Expand Down
15 changes: 14 additions & 1 deletion docs/source/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Release Notes
=============

Version 0.2.35 (2024-07-04)
--------------------------

* **Alpha Version 0.2.35**

**Bug Fixes**

- Bug in accessing simulation data from HuggingFace has been patched

**Documentation**

- Added `FAQ <https://lfl-lab.github.io/SQuADDS/source/getting_started.html#accessing-the-database>`_ for issue with accessing HF data on SQuADDS releases < 0.2.35

Version 0.2.34 (2024-07-04)
--------------------------

Expand All @@ -14,7 +27,7 @@ Version 0.2.34 (2024-07-04)

**Documentation**

- Added tutorial4 files
- Added tutorial3p5 files
- Added README.md, wish_list.md, and docs/source/developer/index.rst from feature-half_wave_cavity (latest)

---
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='SQuADDS',
version='0.2.34',
version='0.2.35',
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 Down
2 changes: 1 addition & 1 deletion squadds/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

__version__ = '0.2.34'
__version__ = '0.2.35'
__license__ = "MIT License"
__copyright__ = 'Sadman Ahmed Shanto, Eli Levenson-Falk 2023'
__author__ = 'Sadman Ahmed Shanto, Eli Levenson-Falk'
Expand Down
17 changes: 13 additions & 4 deletions squadds/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def supported_components(self):
"""
components = []
for config in self.configs:
components.append(config.split("-")[0])
try:
components.append(config.split("-")[0])
except:
pass
return components

def supported_component_names(self):
Expand All @@ -91,7 +94,10 @@ def supported_component_names(self):
"""
component_names = []
for config in self.configs:
component_names.append(config.split("-")[1])
try:
component_names.append(config.split("-")[1])
except:
pass
return component_names

def supported_data_types(self):
Expand All @@ -103,7 +109,10 @@ def supported_data_types(self):
"""
data_types = []
for config in self.configs:
data_types.append(config.split("-")[2])
try:
data_types.append(config.split("-")[2])
except:
pass
return data_types


Expand All @@ -117,7 +126,7 @@ def supported_config_names(self):
delete_HF_cache()
configs = get_dataset_config_names(self.repo_name, download_mode='force_redownload')
# if there are not two "-" in the config name, remove it (since it does conform to the simulation naming convention)
configs = [config for config in configs if len(config.split("-")) == 3]
configs = [config for config in configs if config.count('-') == 2]
return configs

def get_configs(self):
Expand Down
Loading

0 comments on commit 00adeb1

Please sign in to comment.