Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AIASSE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cprutean
AIASSE
Commits
6d14a8fb
Commit
6d14a8fb
authored
2 weeks ago
by
adaramo2
Browse files
Options
Downloads
Patches
Plain Diff
Edit Hydrogen.py
parent
6356ba5c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Hydrogen.py
+14
-5
14 additions, 5 deletions
src/Hydrogen.py
with
14 additions
and
5 deletions
src/Hydrogen.py
+
14
−
5
View file @
6d14a8fb
...
...
@@ -37,6 +37,16 @@ plt.rcParams.update({
'
axes.labelweight
'
:
'
bold
'
})
######################################
# Helper function: Project Root
######################################
def
get_project_root
():
"""
Returns the project root directory.
Assumes this file is in a container (e.g.,
'
src
'
) inside the project.
"""
return
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"
..
"
))
######################################
# Data Reading and Analysis Functions
######################################
...
...
@@ -292,7 +302,7 @@ def plot_ring_clusters_detail_3d(hbonds, molecules, selected_clusters=None, crop
legend_added
[
ring_size
]
=
True
else
:
ax
.
plot
(
x
,
y
,
z
,
color
=
color_map
[
ring_size
],
linewidth
=
3
)
#
NEW:
Highlight the water molecules that form this ring.
# Highlight the water molecules that form this ring.
for
i_node
in
ring
:
ax
.
scatter
(
coords
[
i_node
,
0
],
coords
[
i_node
,
1
],
coords
[
i_node
,
2
],
color
=
color_map
[
ring_size
],
s
=
300
,
edgecolors
=
'
black
'
,
zorder
=
5
)
...
...
@@ -602,9 +612,8 @@ class MainWindow(QMainWindow):
cutoffGroup
.
setLayout
(
cutoffLayout
)
control_layout
.
addWidget
(
cutoffGroup
)
# File paths (adjust if necessary)
self
.
xyz_directory
=
"
Large_box/Large/Accumulation_dependence/DFT_box/
"
# GR file directory removed since not used.
# Set xyz_directory using the absolute project root path.
self
.
xyz_directory
=
os
.
path
.
join
(
get_project_root
(),
"
Large_box
"
,
"
Large
"
,
"
Accumulation_dependence
"
,
"
DFT_box
"
)
# Plot style parameters
self
.
plot_params
=
{
...
...
@@ -884,7 +893,7 @@ class MainWindow(QMainWindow):
f
.
write
(
"
Bar Plot Raw Data
\n
"
)
f
.
write
(
"
-----------------
\n
"
)
f
.
write
(
f
"
Plot type:
{
self
.
last_bar_plot_data
.
get
(
'
plot_type
'
,
''
)
}
\n
"
)
f
.
write
(
"
H-bond-per-molecules\percentage (%)
\n
"
)
f
.
write
(
"
H-bond-per-molecules
\
t
percentage (%)
\n
"
)
for
x
,
y
in
zip
(
self
.
last_bar_plot_data
.
get
(
"
x
"
,
[]),
self
.
last_bar_plot_data
.
get
(
"
y
"
,
[])):
f
.
write
(
f
"
{
x
}
\t
{
y
}
\n
"
)
QMessageBox
.
information
(
self
,
"
Saved
"
,
f
"
Bar plot raw data saved as
{
fname
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment