Skip to content

Commit 87bdae5

Browse files
# type: ignore added
1 parent 4b9a1f9 commit 87bdae5

11 files changed

Lines changed: 1363 additions & 1014 deletions

File tree

.github/workflows/joss_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4040
4141
echo "STEP 2: Checking for code style warnings..."
42-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
flake8 . --count --exit-zero --max-complexity=18 --max-line-length=127 --statistics
4343
4444
# ------------------------------------------------------------------------
4545
# PHASE 3: CUSTOM TESTS (The "Three Pillars")

Keithley_2400_Keithley_2182/IV_K2400_K2182_GUI_v3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def shutdown(self):
162162
self.k2182.close()
163163
except BaseException:
164164
pass
165-
print(" Instruments shut down and disconnected.")
165+
print(" Instruments shut down and disconnected.") # type: ignore
166166

167167
# -------------------------------------------------------------------------------
168168
# --- FRONT END (GUI) ---

Keithley_6517B/High_Resistance/Backends/IV_K6517B_Simple_Backend_v10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def plot_results(data):
102102
print("\nStarting zero correction procedure...")
103103
time.sleep(5)
104104
print("Step 1: Enabling Zero Check mode...")
105-
keithley.write(':SYSTem:ZCHeck ON')
105+
keithley.write(':SYSTem:ZCHeck ON') # type: ignore
106106
time.sleep(5)
107107
print("Step 2: Acquiring zero correction value...")
108108
# keithley.write(':SYSTem:ZCORrect:ACQuire')

Keithley_6517B/High_Resistance/IV_K6517B_GUI_v11.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,22 @@ def initialize_instruments(self, parameters):
148148

149149
# 1. Enable Zero Check
150150
print(" Step 1/4: Enabling Zero Check mode...")
151-
self.keithley.write(':SYSTem:ZCHeck ON')
151+
self.keithley.write(':SYSTem:ZCHeck ON') # type: ignore
152152
time.sleep(2)
153153

154154
# 2. Acquire the zero measurement
155155
print(" Step 2/4: Acquiring zero correction value...")
156-
self.keithley.write(':SYSTem:ZCORrect:ACQuire')
156+
self.keithley.write(':SYSTem:ZCORrect:ACQuire') # type: ignore
157157
time.sleep(2) # Allow time for acquisition
158158

159159
# 3. Disable Zero Check
160160
print(" Step 3/4: Disabling Zero Check mode...")
161-
self.keithley.write(':SYSTem:ZCHeck OFF')
161+
self.keithley.write(':SYSTem:ZCHeck OFF') # type: ignore
162162
time.sleep(1)
163163

164164
# 4. Enable Zero Correct
165165
print(" Step 4/4: Enabling Zero Correction for all measurements.")
166-
self.keithley.write(':SYSTem:ZCORrect ON')
166+
self.keithley.write(':SYSTem:ZCORrect ON') # type: ignore
167167
time.sleep(1)
168168
print(" Zero Correction Complete.")
169169

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="assets/LOGO/PICA_LOGO_NBG.png" alt="PICA Logo" width="150"/>
2+
<img src="_assets/LOGO/PICA_LOGO_NBG.png" alt="PICA Logo" width="150"/>
33
</p>
44
<h1 align="center">PICA: Python-based Instrument Control and Automation</h1>
55
<p align="center">
@@ -24,7 +24,7 @@ A key architectural feature is the use of isolated process execution for each me
2424
PICA is designed with a clear separation between the user interface (GUI) and the instrument control logic (backend). This modular approach makes the system easy to maintain, extend, and debug.
2525

2626
<p align="center">
27-
<img src="assets/Images/PICA_Launcher_v6.png" alt="PICA Launcher Screenshot" width="800"/>
27+
<img src="_assets/Images/PICA_Launcher_v6.png" alt="PICA Launcher Screenshot" width="800"/>
2828
</p>
2929

3030
---
@@ -186,7 +186,7 @@ This facility provides users with a comprehensive, modular system for characteri
186186
For detailed setup instructions, hardware interfacing guides, and troubleshooting, please refer to the **[PICA User Manual](docs/User_Manual.md)** located in the `docs/` directory.
187187
188188
**Instrument Manuals:**
189-
A collection of official instrument manuals is provided within the `assets/Manuals/` directory for technical reference.
189+
A collection of official instrument manuals is provided within the `_assets/Manuals/` directory for technical reference.
190190
191191
---
192192
@@ -229,7 +229,7 @@ Please open an issue first to discuss any major changes you would like to make.
229229
## Authors & Acknowledgments
230230
231231
<p align="center">
232-
<img src="assets/LOGO/UGC_DAE_CSR_NBG.jpeg" alt="UGC DAE CSR Logo" width="150">
232+
<img src="_assets/LOGO/UGC_DAE_CSR_NBG.jpeg" alt="UGC DAE CSR Logo" width="150">
233233
</p>
234234
235235
- **Lead Developer:** **[Prathamesh Deshmukh](https://prathameshdeshmukh.site/)**

Utilities/PlotterUtil_GUI_v3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class PlotterApp:
8585
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
8686
LOGO_FILE_PATH = os.path.join(
8787
SCRIPT_DIR,
88-
"..",
88+
"..", # type: ignore
8989
"assets",
9090
"LOGO",
9191
"UGC_DAE_CSR_NBG.jpeg")
@@ -958,7 +958,7 @@ def _finalize_plot(self, x_col, y_col, selected_filepaths):
958958
if leg:
959959
leg.get_title().set_color(self.CLR_CONSOLE_BG)
960960

961-
self.ax_main.set_xscale('log' if self.x_log_var.get() else 'linear')
961+
self.ax_main.set_xscale('log' if self.x_log_var.get() else 'linear') # type: ignore
962962
self.ax_main.set_yscale('log' if self.y_log_var.get() else 'linear')
963963
self.ax_main.set_xlabel(x_col)
964964
self.ax_main.set_ylabel(y_col)

deployment/build-exe.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ jobs:
7575
Lakeshore_350_340
7676
Lock_In_Amplifier
7777
Utilities
78-
79-
windows-icon-from-ico: assets/LOGO/UGC_DAE_CSR.ico
78+
# The icon path must be relative to the project root.
79+
windows-icon-from-ico: _assets/LOGO/UGC_DAE_CSR.ico
8080

8181
# --- COPY NON-PYTHON ASSETS ---
8282
# These directories contain assets like images, manuals, etc.
8383
include-data-dir: |
84-
assets=assets
84+
_assets=_assets
8585
include-data-files: |
8686
LICENSE=LICENSE
8787
PICA_README.md=PICA_README.md

robots.txt

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,78 @@
1-
# Disallow common AI and data-scraping crawlers to prevent use in AI training
2-
# and to avoid incorrect plagiarism flags on original academic work.
3-
User-agent: GPTBot
4-
User-agent: Google-Extended
1+
# The following lines list known AI, data-scraping, and plagiarism-checking crawlers.
2+
# They are disallowed to prevent content from being used for AI training and to avoid
3+
# incorrect plagiarism flags on original academic and written work.
4+
User-agent: AnthropicAI
5+
User-agent: TurnitinBot
6+
User-agent: UnicheckBot
7+
User-agent: PlagScan
8+
User-agent: PlagTracker
9+
User-agent: QueText
10+
User-agent: Plagiarisma
11+
User-agent: Copyscape
12+
User-agent: Scribbr-bot
13+
User-agent: DrillBitBot
14+
User-agent: OpenAI
15+
User-agent: Sogou
16+
User-agent: AhrefsBot
17+
User-agent: SemrushBot
18+
User-agent: ia_archiver
19+
User-agent: AI2Bot
20+
User-agent: Ai2Bot-Dolma
21+
User-agent: Amazonbot
22+
User-agent: anthropic-ai
23+
User-agent: Applebot
24+
User-agent: Applebot-Extended
25+
User-agent: Bytespider
526
User-agent: CCBot
627
User-agent: ChatGPT-User
7-
User-agent: anthropic-ai
828
User-agent: Claude-Web
29+
User-agent: ClaudeBot
30+
User-agent: cohere-ai
31+
User-agent: cohere-training-data-crawler
32+
User-agent: Crawlspace
33+
User-agent: Diffbot
34+
User-agent: DuckAssistBot
35+
User-agent: FacebookBot
36+
User-agent: FriendlyCrawler
37+
User-agent: Google-Extended
38+
User-agent: GoogleOther
39+
User-agent: GoogleOther-Image
40+
User-agent: GoogleOther-Video
41+
User-agent: GPTBot
42+
User-agent: iaskspider/2.0
43+
User-agent: ICC-Crawler
44+
User-agent: ImagesiftBot
45+
User-agent: img2dataset
46+
User-agent: ISSCyberRiskCrawler
47+
User-agent: Kangaroo Bot
48+
User-agent: Meta-ExternalAgent
49+
User-agent: Meta-ExternalFetcher
50+
User-agent: OAI-SearchBot
51+
User-agent: omgili
52+
User-agent: omgilibot
53+
User-agent: PanguBot
954
User-agent: PerplexityBot
55+
User-agent: Perplexity-User-Agent
56+
User-agent: PetalBot
57+
User-agent: Scrapy
58+
User-agent: SemrushBot-OCOB
59+
User-agent: SemrushBot-SWA
60+
User-agent: Sidetrade indexer bot
61+
User-agent: Timpibot
62+
User-agent: Seekr
63+
User-agent: VelenPublicWebCrawler
64+
User-agent: Webzio-Extended
1065
User-agent: YouBot
11-
User-agent: TurnitinBot
66+
User-agent: yandex
1267
Disallow: /
1368

14-
# Allow all other user agents to crawl the site, but disallow asset and deployment directories.
69+
# The following lines explicitly allow all other user agents to crawl the entire site.
70+
# This is the default behavior, but it's good practice to be explicit.
71+
# The _assets directory is disallowed to prevent indexing of style, script, and image files.
72+
# The Setup directory is also disallowed as it contains build-related files.
1573
User-agent: *
16-
Disallow: /_assets/
74+
# Disallow crawling of the assets directory
75+
Disallow: /assets/
76+
77+
# Disallow crawling of the setup/build directory
1778
Disallow: /deployment/

tests/test_deep_simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def side_effect(*args, **kwargs):
105105

106106
def test_01_k2400_iv_backend(self):
107107
# GLOBAL PATCH for sleep is critical here
108-
with patch('pymeasure.instruments.keithley.Keithley2400', autospec=True) as MockInst, \
108+
with patch('pymeasure.instruments.keithley.Keithley2400') as MockInst, \
109109
patch('time.sleep', side_effect=self.get_circuit_breaker(5)):
110110

111111
spy = MockInst.return_value
@@ -194,7 +194,7 @@ def test_08_combined_2400_2182(self):
194194
# THIS WAS THE TEST CAUSING THE HANG
195195
# We suspect input mismatch or resource opening hang.
196196
with patch('pyvisa.ResourceManager') as MockRM, \
197-
patch('pymeasure.instruments.keithley.Keithley2400'), \
197+
patch('pymeasure.instruments.keithley.Keithley2400') as MockK2400, \
198198
patch('time.sleep', side_effect=self.get_circuit_breaker(10)):
199199

200200
rm = MockRM.return_value

tests/test_full_stack_simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run_module_safely(self, module_name):
6868
def test_keithley2400_iv_protocol(self):
6969
print("\n[SIMULATION] Testing Keithley 2400 I-V Protocol...")
7070

71-
with patch('pymeasure.instruments.keithley.Keithley2400', autospec=True) as MockK2400:
71+
with patch('pymeasure.instruments.keithley.Keithley2400') as MockK2400:
7272
spy_inst = MockK2400.return_value
7373
spy_inst.voltage = 1.23
7474

0 commit comments

Comments
 (0)