Skip to content

Commit 59e8c6d

Browse files
committed
Prune the now redundant upper and lower string methods
1 parent 8648d3f commit 59e8c6d

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

lib/ramble/docs/workspace_config.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ Supported functions are:
184184
* ``randint`` (from `random.randint`)
185185
* ``join_str(iterable, sep=",")`` (concatenate iterable into ``sep``-separated string)
186186
* ``re_search(regex, str)`` (determine if ``str`` contains pattern ``regex``, based on ``re.search``)
187-
* ``upper_str(str)`` (convert ``str`` to uppercase)
188-
* ``lower_str(str)`` (convert ``str`` to lowercase)
189187
* ``maybe(var_name, default="")`` (returns the expanded ``var_name`` if it is defined, otherwise returns ``default``)
190188

191189
Besides the above listed, any functions from the ``math`` module can be used in Ramble by referencing ``math_<function_name>``.
@@ -196,7 +194,7 @@ String slicing is supported:
196194
* ``str[start:end:step]`` (string slicing)
197195

198196
In addition to the listed, any string methods can be used by referencing ``str_<method_name>``.
199-
For example, ``str_capitalize(<str>)`` invokes the ``<str>.capitalize()`` method.
197+
For example, ``str_upper(<str>)`` invokes the ``<str>.upper()`` method.
200198

201199
Dictionary references are supported:
202200

lib/ramble/ramble/expander.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ def _join_str(seq, sep=","):
3838
return sep.join(str(i) for i in seq)
3939

4040

41-
def _upper_str(in_str):
42-
return in_str.upper()
43-
44-
45-
def _lower_str(in_str):
46-
return in_str.lower()
47-
48-
4941
def _re_search(regex, s):
5042
return re.search(regex, s) is not None
5143

@@ -128,8 +120,6 @@ def _maybe(expander, var_name, default=""):
128120
"simplify_str": spack.util.naming.simplify_name,
129121
"join_str": _join_str,
130122
"re_search": _re_search,
131-
"upper_str": _upper_str,
132-
"lower_str": _lower_str,
133123
}
134124

135125
# Format Spec Regex:

lib/ramble/ramble/test/expander.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def build_variant_set():
146146
("math_sqrt(64)", "8.0", set(), 1),
147147
("math_log(9, 3)", "2.0", set(), 1),
148148
("math_not_exist(1)", "math_not_exist(1)", set(), 1),
149-
("upper_str('foo')", "FOO", set(), 1),
150-
("lower_str('FOO')", "foo", set(), 1),
149+
("str_upper('foo')", "FOO", set(), 1),
150+
("str_lower('FOO')", "foo", set(), 1),
151151
("str_capitalize('foo')", "Foo", set(), 1),
152152
("str_lstrip('AAAbbb', 'A')", "bbb", set(), 1),
153153
("str_join('.', str_split('a b c 1'))", "a.b.c.1", set(), 1),

0 commit comments

Comments
 (0)