Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gboml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
smart_grids
public
gboml
Commits
91e9c97a
Commit
91e9c97a
authored
9 months ago
by
T-3B
Browse files
Options
Downloads
Patches
Plain Diff
revert changes for printing Meta during parsing
parent
6a69c45f
No related branches found
Branches containing commit
Tags
v0.1.7
Tags containing commit
No related merge requests found
Pipeline
#35190
failed
9 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gboml/parsing.py
+1
-3
1 addition, 3 deletions
src/gboml/parsing.py
src/main.py
+8
-11
8 additions, 11 deletions
src/main.py
with
9 additions
and
14 deletions
src/gboml/parsing.py
+
1
−
3
View file @
91e9c97a
...
...
@@ -11,9 +11,7 @@ from gboml.tools.tree_modifier import modify, visit
def
_op_transform
(
op
):
return
lambda
*
x
,
meta
:
ExpressionOp
(
op
,
list
(
x
),
meta
=
meta
)
def
_bool_op_transform
(
op
):
return
lambda
*
x
,
meta
:
BoolExpressionOp
(
op
,
list
(
x
),
meta
=
meta
)
def
gen_meta
(
lark_token
:
Token
)
->
Meta
:
print
(
lark_token
.
line
,
lark_token
.
column
)
return
Meta
(
line
=
lark_token
.
line
,
column
=
lark_token
.
column
,
filename
=
None
)
def
gen_meta
(
lark_token
:
Token
)
->
Meta
:
return
Meta
(
line
=
lark_token
.
line
,
column
=
lark_token
.
column
,
filename
=
None
)
def
_vargs
(
f
,
data
,
children
,
_meta
):
...
...
This diff is collapsed.
Click to expand it.
src/main.py
+
8
−
11
View file @
91e9c97a
...
...
@@ -4,21 +4,18 @@ from gboml.parsing import GBOMLParser
from
gboml.semantic
import
semantic_check
from
gboml.scope
import
RootScope
tree
=
GBOMLParser
().
parse
(
"""
#TIMEHORIZON
T = 1;
#GLOBAL
b = 4;
tree
=
GBOMLParser
().
parse
(
"""
// Test working constrainting and optimizing only one element of vector
// Working example where x = -4
#TIMEHORIZON
T = 10;
#NODE H
#VARIABLES
internal : x;
internal : y;
#NODE A
#VARIABLES
internal : x[T];
#CONSTRAINTS
x
<=-4
;
x
[T-1]>=0
;
#OBJECTIVES
m
ax : x + global.b
;
m
in: x[T-1]
;
"""
)
# c = 2e2;
# d = -1;
...
...
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